LinuxCommandLibrary

setmetamode

Configure display metamodes for multihead setups

SYNOPSIS

setmetamode [OPTION]...
setmetamode { -e | --esc | -8 | --8bit }

PARAMETERS

-e, --esc
    Sets the Meta key to send an Escape character as a prefix when combined with another key. This mode is often preferred by applications that rely on ESC sequences for Meta key recognition.

-8, --8bit
    Sets the Meta key to set the 8th bit of the character when combined with another key. This effectively makes the character an 8-bit character, useful for certain character encodings like ISO 8859-1.

-h, --help
    Displays a help message showing usage information and exits.

-v, --version
    Displays the version information for the setmetamode utility and exits.

DESCRIPTION

The setmetamode command is a utility from the kbd package used to control how the keyboard's Meta key (typically the Alt key) behaves in the Linux console (text mode). It allows you to define whether the Meta key, when pressed with another key, generates an 8-bit character (by setting the 8th bit) or sends an Escape character as a prefix. This distinction is crucial for how certain applications, especially older terminal programs or command-line utilities like Emacs, interpret Meta key combinations. By default, many systems might use the 8-bit mode. Switching to Escape-prefix mode (using -e) can resolve issues where Meta key combinations aren't recognized correctly by some console applications. Conversely, the 8-bit mode (using -8) is often desired for ISO 8859-1 compatible character input. The command affects the current console session and is typically managed by privileged users due to its system-wide keyboard impact within the console.

CAVEATS

This command primarily affects the virtual consoles (text mode terminals) and has no direct impact on graphical environments (like X11, Wayland) or terminal emulators running within them. Its behavior can sometimes be overridden or configured by loadkeys or specific terminal settings, which might lead to unexpected interactions if not managed carefully.

META KEY INTERPRETATION

The Meta key's interpretation is crucial for console applications.
In Escape-prefix mode (-e), pressing Alt-A sends the sequence "ESC A".
In 8-bit mode (-8), it sends a single character with its 8th bit set (e.g., Alt-A might produce a different character depending on the character set). The choice depends on the application's expected input behavior.

HISTORY

The setmetamode utility is part of the kbd package, which provides essential tools for managing the Linux console keyboard and fonts. Its functionality has been a stable component of Linux console management for many years. It addresses the critical need for configuring the nuanced behavior of keyboard input, particularly concerning international character sets and specialized key combinations required by text-based applications like Emacs or vi in console environments.

SEE ALSO

Copied to clipboard