---
name: "menu.4th"
section: "8"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/menu.4th"
---

# menu.4th(8)

FreeBSD dynamic menu boot module

## NAME

**menu.4th** – FreeBSD dynamic menu boot module

## DESCRIPTION

The file that goes by the name of **menu.4th** is a set of commands designed to display a dynamic menu system managed through a system of carefully named environment variables. The commands of **menu.4th** by themselves are not enough for most uses. Please refer to the examples below for the most common situations, and to [loader(8)](/loader/8.md) for additional commands.

Before using any of the commands provided in **menu.4th**, it must be included through the command:

```
include menu.4th
```

This line is present in the default */boot/menu.rc* file, so it is not needed (and should not be re-issued) in a normal setup.

The commands provided by it are:

- **menu-init**

  Draws the menu bounding box and initializes some internal state variables. This should be called before any other menu-related functions.

- **menu-display**

  Displays the menu (configured via the below documented environment variables) and blocks on keyboard input, awaiting user action.

- **menu-erase**

  Clears the screen area within the menu bounding box.

- **menu-redraw**

  Calls **menu-erase** and then redraws the menu.

- **menu-unset**

  Unsets the environment variables associated with individual menu items, clearing the way for a new menu.

- **menu-clear**

  Calls **menu-unset** and then **menu-erase**.

The environment variables that effect its behavior are:

- *loader\_color*

  If set to “NO” (case-insensitive) or “0”, causes the menu to be displayed without color. The default is to use ANSI coloring whenever possible. If serial boot is enabled, color is disabled by default. Color features include the use of ANSI bold for numbers appearing to the left of menuitems and the use of special “ansi” variables described below.

- *autoboot\_delay*

  Number of seconds **menu-display** will wait before executing *menu\_timeout\_command* (**boot** by default) unless a key is pressed. If set to “NO” (case-insensitive) **menu-display** will wait for user input and never execute **menu\_timeout\_command**. If set to “-1”, **menu-display** will boot immediately, preventing both interruption of the **autoboot** process and escaping to the loader prompt. Default is “10”. See [loader(8)](/loader/8.md) for additional information.

- *menu\_timeout\_command*

  The command to be executed after *autoboot\_delay* seconds if a key is not pressed. The default is **boot**.

- *loader\_menu\_frame*

  Sets the desired box style to draw around the boot menu. Possible values are: “single” (the default), “double”, and “none”.

- *loader\_menu\_timeout\_x*

  Sets the desired column position of the timeout countdown text. Default is 4.

- *loader\_menu\_timeout\_y*

  Sets the desired row position of the timeout countdown text. Default is 23.

- *loader\_menu\_title*

  The text to display above the menu. Default is “Welcome to FreeBSD”.

- *loader\_menu\_title\_align*

  Default is to align **loader\_menu\_title** centered above the menu. This can be set to “left” or “right” to instead display the title left-or-right justified (respectively).

- *loader\_menu\_x*

  Sets the desired column position of the boot menu. Default is 5.

- *loader\_menu\_y*

  Sets the desired row position of the boot menu. Default is 10.

- *menu\_caption\[x\]*

  The text to be displayed for the numbered menuitem “x”.

- *menu\_command\[x\]*

  The command to be executed when the number associated with menuitem “x” is pressed. See the list of included FICL words below for some ideas.

- *menu\_keycode\[x\]*

  An optional decimal ASCII keycode to be associated with menuitem “x”. When pressed, will cause the execution of *menu\_command\[x\]*.

- *ansi\_caption\[x\]*

  If *loader\_color* is set (enabled by default), use this caption for menuitem “x” instead of *menu\_caption\[x\]*.

- *toggled\_text\[x\]*

  For menuitems where *menu\_command\[x\]* is set to “toggle\_menuitem” (or a derivative thereof), the text displayed will toggle between this and *menu\_caption\[x\]*.

- *toggled\_ansi\[x\]*

  Like *toggled\_text\[x\]* except used when *loader\_color* is enabled (default).

- *menu\_caption\[x\]\[y\]*

  For menuitems where *menu\_command\[x\]* is set to “cycle\_menuitem” (or a derivative thereof), the text displayed will cycle between this and other *menu\_caption\[x\]\[y\]* entries.

- *ansi\_caption\[x\]\[y\]*

  Like *menu\_caption\[x\]\[y\]* except used when *loader\_color* is enabled (default).

- *menu\_acpi*

  When set to a number “x” associated with a given menuitem, that menuitem will only appear when running on ACPI-compatible hardware, *acpi.rsdp* is set (indicating the presence of hardware ACPI support as detected by [loader(8)](/loader/8.md)), and *hint.acpi.0.disabled* is not set. On non-i386 hardware, menuitems configured after the “menu\_acpi” menuitem will use a lower number (to compensate for the missing ACPI menuitem) but continue to function as expected. On i386-compatible hardware lacking ACPI support (as detected by [loader(8)](/loader/8.md)), subsequent menuitems will retain their associated numbers.

- *acpi.rsdp*

  Set automatically by [loader(8)](/loader/8.md) on ACPI-compatible hardware when ACPI support is detected at boot time. Effects the display of the “menu\_acpi” menuitem (if configured).

- *hint.acpi.0.disabled*

  Effects the display of the *menu\_acpi* menuitem. If set, the menuitem will display *toggled\_text\[x\]* (*toggled\_ansi\[x\]* if *loader\_color* is set), otherwise *menu\_caption\[x\]* (*ansi\_caption\[x\]* if *loader\_color* is set).

- *menu\_options*

  When set to a number “x”, a single blank-line and an “Options” header are inserted between *menu\_caption\[x-1\]* and *menu\_caption\[x\]* (if configured).

- *menu\_reboot*

  If set, adds a built-in “Reboot” menuitem to the end of the last configured menuitem. If *menu\_options* is configured, the “Reboot” menuitem will be inserted before the “Options” separator.

In addition, it provides the following FICL words:

- **arch-i386?** (**--** **BOOL**)

  Returns true (-1) on i386 and false (0) otherwise.

- **acpipresent?** (**--** **BOOL**)

  Returns true (-1) if ACPI is present and false (0) otherwise.

- **acpienabled?** (**--** **BOOL**)

  Returns true (-1) if ACPI is enabled and false (0) otherwise.

- **toggle\_menuitem** (**N** **--** **N**)

  Toggles menuitem “N” between *menu\_caption\[x\]* and *toggled\_text\[x\]* (where “N” represents the ASCII decimal value for “x”).

- **cycle\_menuitem** (**N** **--** **N**)

  Cycles menuitem “N” between *menu\_caption\[x\]\[y\]* entries (where *N* represents the ASCII decimal value for *x*).

For all values of “x” above, use any number between 1 through 9. Sorry, double-digits are not currently supported.

## FILES

- */boot/loader*

  The [loader(8)](/loader/8.md).

- */boot/menu.4th*

  **menu.4th** itself.

- */boot/loader.rc*

  [loader(8)](/loader/8.md) bootstrapping script.

## EXAMPLES

A simple boot menu:

```
include /boot/menu.4th
menu-init
set menu_caption[1]="Boot"
set menu_command[1]="boot"
set menu_options=2
set menu_caption[2]="Option: NO"
set toggled_text[2]="Option: YES"
set menu_command[2]="toggle_menuitem"
set menu_timeout_command="boot"
set menu_reboot
menu-display
```

## SEE ALSO

[loader.conf(5)](/loader.conf/5.md), [beastie.4th(8)](/beastie.4th/8.md), [loader(8)](/loader/8.md), [loader.4th(8)](/loader.4th/8.md)

## HISTORY

The **menu.4th** set of commands first appeared in FreeBSD 9.0.

## AUTHORS

The **menu.4th** set of commands was written by Devin Teske ⟨*dteske@FreeBSD.org*⟩.
