LinuxCommandLibrary

luit

Run terminal applications with specified locale

SYNOPSIS


luit [options] [command [arguments...]]

PARAMETERS

-V or --version
    Displays the version number and exits.

-h or --help
    Shows a help message and exits.

-v or --verbose
    Prints verbose diagnostic messages during operation.

-t or --transparent
    Acts as a transparent filter; no character set conversion is performed. Useful for debugging character flow.

-p or --pretend-terminal
    Does not attempt to adjust the terminal settings (e.g., character mapping) but still performs character set conversion.

-l locale or --locale=locale
    Specifies the locale name to use for character set conversions. Overrides the system locale environment variables.

-c or --character-sets
    Prints a list of all supported character sets and exits.

-k codeset or --keyboard=codeset
    Specifies the character set of the keyboard input. This is what luit expects from the user's keyboard.

-s codeset or --screen=codeset
    Specifies the character set of the screen output. This is what the terminal emulator expects to display.

-i codeset or --input=codeset
    Specifies the character set of the program's input (what luit receives from the wrapped program's standard output).

-o codeset or --output=codeset
    Specifies the character set of the program's output (what luit sends to the wrapped program's standard input).

-e encoding or --encoding=encoding
    Deprecated. This option is superseded by the more granular -l, -k, -s, -i, and -o options.

-g codeset or --display-codeset=codeset
    Specifies the character set for display output, functionally similar to -s.

-m codeset or --mouse-codeset=codeset
    Specifies the character set for mouse reporting (e.g., coordinates sent by mouse events).

--
    A special argument that indicates the end of luit's options. All arguments following -- are treated as the command to be executed by luit.

DESCRIPTION

luit (Locale un-independent terminal) is a character set filter that allows X terminals (like xterm) to support different locales and encodings beyond the traditional Latin-1 or ASCII. It translates data between the locale's character set (e.g., UTF-8, EUC-JP) and the terminal's character set (usually ISO-8859-1 or UCS-2 for xterm). This is crucial for displaying non-Latin scripts (like Japanese, Chinese, Korean) or characters outside the basic ASCII range correctly in terminals that might not natively understand those encodings.

Typically, luit is invoked as a wrapper around another command, such as xterm, like luit -l zh_CN.GBK -- xterm. It intercepts the input and output streams, performing character set conversions on the fly. This ensures that what you type is correctly interpreted by the application, and what the application outputs is correctly displayed by your terminal. Without luit, an older xterm might display garbled text when an application tries to output characters from a different character set. Modern xterm versions often have better native UTF-8 support, reducing the explicit need for luit in many common scenarios, but it remains valuable for specific legacy setups or fine-grained control over encoding.

CAVEATS

luit relies heavily on correct locale configuration. If the system's LANG or LC_CTYPE environment variables are not set appropriately, luit might not function as expected or might choose an incorrect default encoding.

Modern versions of xterm (and most other popular terminal emulators like Gnome Terminal, Konsole, Alacritty, kitty) have robust native UTF-8 support built-in. In such environments, luit is often unnecessary when the primary goal is to display UTF-8 content, as the terminal itself handles the encoding. Its primary utility now lies in situations where a specific non-UTF-8 encoding is required, or with older terminal emulators that lack full Unicode support.

TYPICAL USAGE

luit is almost always used as a wrapper for another command. A common invocation is:
luit -l zh_CN.UTF-8 -- xterm
This command starts xterm with luit handling the character set conversion to and from UTF-8, assuming the locale is Chinese (Simplified, UTF-8). The -- argument is crucial as it tells luit that all subsequent arguments are part of the command to be executed, not options for luit itself. This allows luit to manage the character encoding layer between your shell/applications and the terminal's display.

HISTORY

luit was developed as part of the X.Org project to address a long-standing limitation of X terminals: their inability to handle multiple character sets beyond the default ISO-8859-1 or ASCII. Early xterm versions lacked native support for complex encodings like Japanese, Chinese, or Korean. luit filled this gap by acting as a transparent proxy, converting character streams between the application's locale encoding and the terminal's native encoding. This allowed users to display and input characters from various languages in xterm environments that otherwise wouldn't support them. Its development was crucial for internationalization within the X Window System.

SEE ALSO

xterm(1), locale(1), iconv(1), setlocale(3)

Copied to clipboard