Input language and the lang command
A command word such as help does not travel to other languages.
This page specifies how a shell lets one user type its command words in their own language, how the user switches that language, and how the switch is shown.
It is about input: the words the user types.
It is not about output, which is the language a tool answers in (the -lang switch of CH-29 and CH-10).
The key words MUST, MUST NOT, SHOULD, SHOULD NOT and MAY are to be interpreted as described in BCP 14unchecked (RFC 2119, RFC 8174) when, and only when, they appear in all capitals.
Requirement ids (IL-n) are stable: an id is never reused or renumbered.
The requirements apply to a conforming shell. Today that means Plus Shell’s native oso mode; they do not apply to tools, and legacy shells cannot implement them (Legacy shells).
|
Status labels
DECIDED means Ryan decided it (2026-12-05, relayed by D Lang: "OK all of that is fair. Make it."). PROPOSED means D Lang proposed it and Ryan called it fair without itemising it as decided; it is written as a requirement so implementers can build and test it, and it changes only if Ryan amends it. OPEN means undecided; the text says what implementers should do meanwhile. |
Input language versus output language
| Input language | Output language | |
|---|---|---|
What it is |
The language the user types the shell’s command words in ( |
The language a tool or help system answers in. |
Set by |
The |
|
Scope |
The shell session. Never exported to child processes. |
One invocation. |
Spelled |
|
|
The two names are close on purpose and can be confused; this page flags that and does not resolve it.
Neither setting reads the other: choosing an input language MUST NOT change the output language, and -lang MUST NOT change the input language (IL-14).
The command
- IL-1
-
DECIDED. A conforming shell MUST provide a built-in command
lang, and MUST registerLas a declared alias of it (analiasnode, NS-1, pointing atlang). Both register at the root of the command namespace; a tool that claims either path is a conflict (NS-3).
lang-command = ( "lang" / "L" ) [ SP argument ]
argument = region / code / number ; one argument at most
region = 1*( LOWER / DIGIT / "-" ) ; a keyword from the region list, see Regions
code = <see Language codes>
number = 1*DIGIT ; picks an entry of the list printed by the previous lang call
| Invocation | Effect | Exit |
|---|---|---|
|
Prints the current input language ( |
|
|
Narrows: prints the languages in that region (or its subregions, [il-regions]) and how to pick one. Changes nothing. |
|
|
Sets the input language for the session ([il-setting]) and prints the new |
|
|
Picks entry n of the list printed by the previous |
|
|
Identical to the same invocation of |
as |
|
Help for |
|
- IL-2
-
langaccepts no subcommand words. A word such aslist,all,setornonewould also be a valid hyphenless language code (measured against the IANA Language Subtag Registry, File-Date 2026-11-30:listparses asli+ST,noneasno+NE,allandsetare ISO 639-3 languages), so every argument oflangis a region keyword, a code, or a number, and nothing else. DECIDED in consequence of the accepted hyphenless codes.
Language codes
- IL-3
-
DECIDED.
lang <code>and-lang <code>accept the same three spellings of one language tag, case-insensitively: BCP 47 (en-US,zh-Hant,es-419), POSIX style with underscores (en_us,zh_hant), and hyphenless (enus,zhhant,es419). Ryan acceptsen_usas a necessary tradeoff even though it is harder to type.
code = bcp47 / posix / hyphenless
bcp47 = language [ "-" script ] [ "-" region ]
posix = language [ "_" script ] [ "_" region ]
hyphenless = language [ script ] [ region ]
language = 2*3ALPHA
script = 4ALPHA
region = 2ALPHA / 3DIGIT
; ALPHA matches either case. A hyphenless code is unambiguous by length (below).
The shell MUST normalize every accepted code to its canonical BCP 47 spelling (language lower case, script title case, region upper case: en-US, zh-Hant, es-419) before comparing, storing or displaying it.
A .codeset or @modifier suffix (en_US.UTF-8, de_DE@euro) is not part of the grammar: it is a usage error (Errors). Whether to strip such suffixes is OPEN.
| Letters in the alphabetic run | Read as | Example |
|---|---|---|
2 or 3 |
language |
|
4 |
language (2) + region (2) |
|
5 |
language (3) + region (2) |
|
6 |
language (2) + script (4) |
|
7 |
language (3) + script (4) |
|
8 |
language (2) + script (4) + region (2) |
|
9 |
language (3) + script (4) + region (2) |
|
any of the above followed by exactly 3 digits |
the same, with a 3-digit region |
|
Every other length is not a code. The parse is deterministic: one string has at most one reading, so the grammar itself produces no collisions between two locales.
The pieces MUST then be valid: the language, script and region subtags MUST be present in the IANA Language Subtag Registry the shell ships, and a code whose pieces are not registered is not a code (help, africa, asia, europe, oceania, other and global are not codes; list, none, home, bin and dev are, which is why IL-2 exists).
- IL-4
-
DECIDED (build-time collision checks). The build of a shell (and of every language pack) MUST fail when any of these holds over the shipped packs:
-
Two different canonical locales normalize to the same lower-case, separator-free key (for example if an alias list maps
enusto two packs). -
A normalized locale key equals a region keyword ([il-regions]), a reserved word of
lang(none today), or a canonical token of the shell (help,and,or,not, [il-tokens]). -
Inside one pack, a localized word equals a canonical token that the pack maps to a different canonical token, or two localized words in the pack differ only by case.
The check is cheap and total, because the shipped locale list is finite. A user-installed pack MUST pass the same check at install time and be rejected, with the clashing key named, when it fails.
-
- IL-5
-
PROPOSED. When the language part of a code has more than one regional pack and no pack for the language alone (for example
lang enwith onlyen-USanden-GBinstalled), the shell MUST NOT pick one. It prints a disambiguation response on stderr listing each candidate with its hyphenless spelling, changes nothing, and exits2:error: 'en' has regional variants; pick one en-US : enus en-GB : engb see: lang -helpThis is not prefix matching:
lang enis the exact language codeen, and it resolves only if a pack for exactlyenexists.
Regions
- IL-6
-
DECIDED that the language list is condensed into regions, and that
lang <region>narrows to one. PROPOSED: the top-level region keywords are the five UN M.49 continental regions, lower case:africa,americas,asia,europe,oceania. A language appears under every region where it is spoken by a large community, so a language may be listed in more than one. Subregion keywords (hyphenated, for examplewestern-africa) MAY narrow further. The exact region and subregion list, and the membership of each language, is OPEN; a pack manifest carries the membership, and the shell MUST NOT hard-code it.Every region keyword MUST pass the collision check in IL-4. Measured 2026-12-05 against the IANA registry (File-Date 2026-11-30): none of the five continental keywords,
other,global,antarctica,arctic,caribbeanorwestern-africaparses as a language code.
The preamble indicator
- IL-7
-
DECIDED. The shell preamble (the line or lines the shell prints above the command line, the composition block of the Plus Shell UI) MUST show the current input language as the globe emoji U+1F310 (
), one space, and the canonical BCP 47 code:
preamble-lang = %x1F310 SP code ; 🌐 en-US-
The indicator MUST NOT use a flag emoji (a pair of regional-indicator symbols, U+1F1E6 to U+1F1FF). Flags mean countries, not languages, and Windows Terminal cannot render them (they show as the two letters).
-
The indicator MUST NOT be written
L=en,LANG=en, or in any otherNAME=valueform, because it reads as a bash variable assignment. -
The indicator MUST appear on every prompt, including the first, and MUST reflect a change immediately after
langruns.A terminal that cannot draw U+1F310 needs an ASCII indicator. Whether the shell detects that, and what the plain-text form is, is OPEN. open-shell v0.2.0 prints
[code](for example[en-US]) there; whether[code]stays the plain-text globe fallback is OPEN.
-
Clicking the indicator (OSC 8)
- IL-8
-
DECIDED. The indicator, and each region and language in the output of
lang, MUST be clickable where the terminal supports OSC 8 hyperlinks. A click runs the samelanginvocation the text names: clicking the preamble runslang; clickingafricarunslang africa, which narrows the list; clicking a language runslang <code>.OSC 8 hyperlinks are supported by Windows Terminal, iTerm2, kitty, WezTerm and VTE-based terminals; they are not supported by conhost. The shell SHOULD detect support from the terminal’s own markers (for example
WT_SESSION,TERM_PROGRAM,KITTY_WINDOW_ID,VTE_VERSION) and fall back to the numbered menu ([il-menu]) when none is present. It MUST NOT emit hyperlink escape sequences when stdout is not a terminal (CH-19).A click MUST NOT run anything but
langwith an argument the shell itself generated (a region keyword, a code of an installed pack, or nothing). The link target is data the shell wrote; a hyperlink in any other program’s output MUST NOT be able to runlangwith an arbitrary argument.PROPOSED: the link target is a URI in the reserved scheme
oso-lang:whose path is the argument (oso-lang:for barelang,oso-lang:africa,oso-lang:en-US). OPEN: how the click reaches the shell. Most terminals hand an OSC 8 target to the operating system rather than to the program that printed it, so the shell’s own terminal host (or a registered URI handler for the scheme) must route it back and inject the command. Until that routing exists in a given terminal, the numbered menu is the working path there.
Keeping the command line
- IL-10
-
DECIDED. When
langruns while the user has text in the command line (always the case after a click), the shell MUST preserve it: take the buffer (text, cursor position and any selection), runlang, print its output, then put the buffer back at the next prompt, unchanged and not executed. This holds whenlangsucceeds and when it fails.Prior art: zsh’s
push-line,push-inputandpush-line-or-editwidgets push the current buffer onto a stack and pop it back at the next prompt (zshzle;get-lineis the counterpart). fish and bash/readline have no stock equivalent (fish users write a function aroundcommandline; readline users fall back to Ctrl+U and Ctrl+Y). PSReadLine has no stock widget by that name; aSet-PSReadLineKeyHandlerscript block can stash and restore the buffer withGetBufferStateandInsert(see the custom key bindings section ofabout_PSReadLine).Two sub-questions are OPEN: (a) whether the click-run
langcall is added to history; (b) what happens to words in the restored buffer that were localized words of the previous input language (the restored text is unchanged, so those words are read under the new language; a canonical token always works, [il-tokens], and the hint SHOULD flag a word that no longer resolves).
The hint under the line
- IL-11
-
DECIDED that the autosuggestion hint under the command line explains
langwhen the user typeslangorL. PROPOSED text (one row, truncated to the terminal width, as for any hint row):lang [<region>|<code>] set the input language (now 🌐 en-US). Output language is -lang.
Setting, canonical tokens and scripts
- IL-12
-
PROPOSED (D Lang). The input language is a shell or environment setting, not a per-command option. The initial value is the shell’s setting, else the OS input language, else English.
lang <code>changes it for the session. The shell MUST NOT export it to child processes and MUST NOT write the POSIXLANGorLC_*variables, because those select a tool’s output locale. Whetherlang <code>also writes the persistent setting is OPEN; the setting lives in the shell’s own config file, following the config-file ownership rules.
- IL-13
-
PROPOSED (D Lang). Canonical English tokens ALWAYS work, in every input language. A language pack maps localized words one-to-one onto canonical tokens (for example
ayudatohelp). A word that is neither a canonical token nor in the active pack is an ordinary unknown word and gets the usual error (CD-1), which SHOULD name the canonical token if the word belongs to another installed pack. Which tokens are localizable is OPEN: the recommendation is the shell’s own words (help,and,or,notand the bare-word nodes the shell registers) and the mode keys of CH-27, not tool-declared options, which stay as the tool declares them. A localized mode key MUST NOT be a valid ISO 639 primary language subtag (the CH-27 rule).
- IL-14
-
PROPOSED (D Lang). Scripts are portable: the shell MUST save and normalize every script, export and history copy with canonical tokens, and MUST read script files with canonical tokens only, whatever the active input language. A line typed in Spanish and saved to a script is stored in English tokens. The input language is separate from
-lang: neither reads nor sets the other.
An illustrative pack (the file format is PROPOSED; it follows the JSON5 rule for manifests):
{
pack: 0,
locale: "es",
words: { ayuda: "help", y: "and", o: "or", no: "not" },
}
Legacy shells
lang and L exist only in a conforming shell. In bash, zsh, fish, PowerShell and cmd, lang is whatever the user’s PATH makes it, and there is no equivalent to type: a legacy shell has no input language to switch. Use -lang for a tool’s output language and the OS locale for the rest. The optional shell companion MUST NOT add a lang function or rewrite lang / L.
Errors
Errors follow CD-1 and CD-8: name the input, point to help, write to stderr, and exit 2 for a usage error.
| Input | stderr | Exit |
|---|---|---|
|
|
|
|
The disambiguation response of IL-5. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Not adopted
A leading-/ built-in (/en, /es, with plain /en disambiguating to /enus and /engb) was considered and dropped (2026-12-05). The reasons are on record in the schema-first seed:
a leading / is the filesystem root in every legacy shell, so /en is a path there;
the 2026-12-05 check against the official ISO 639-3 code set (SIL, tables dated 2026-10-15) found common root folders that are language codes (bin, run, dev, lib, var, sys, opt, etc, srv, and retired tmp and mnt), and hyphenless /home reads as ho-ME;
and Git Bash and MSYS2 rewrite a leading-/ argument before a native program sees it (/i arrives as I:/; /en arrives as C:/Program Files/Git/en or C:/msys64/en).
The rule that replaced it is in NS-15, the slash namespace separator: a token that starts with / is a path, always.
Implementation status (2026-12-06)
-
plush v0.3.1unchecked (2026-12-06) is the current release. The rename from
open-shelllanded in plush v0.3.0unchecked (plush#1unchecked,59c6dd3): the command, the DUB packageplushunchecked (0.3.0 and 0.3.1), the release files, the Windows Terminal fragment, and the shim packagefreecli.plush(commandsplushandosh) all use the new name. v0.3.1 (commita10fd5b) fixestools/install-windows-terminal-fragment.ps1, which in v0.3.0 could exit before copyingplush.jsonandplush.icointoFragments\FreeCLI\. Theososyntax mode, theoso-lang:link scheme, the+oso1.0.0build-metadata prefix, theOSO_*environment variables, andosh-shimare unchanged. -
The input-language behaviour described next was released in open-shell v0.2.0unchecked: help for the shell and for
langcomes from prohelp, and-hand--helpstill open help. The input-language command follows this page: the globe and code, a numbered list, andoso-langlinks where the terminal can draw the globe (the v0.2.0 release notes). open-shell v0.2.1unchecked (2026-12-05) fixed the Windows Terminal packaging under the oldopen-shellfile names. -
prohelp v0.3.2unchecked is current (prohelp#2unchecked; URL and text updates for FreeCLI; also on DUB). The alignment with CH-27, CH-28 and CH-29 landed in prohelp v0.3.1unchecked.
-
langcodes v0.1.1unchecked: BCP 47 language tags, normalization and hyphenless collision checks for D (IL-3, IL-4). The DUB package name is unchanged.
-
command-namespace
mainatf5202f5unchecked: the CI macOS job runs onmacos-latest(GitHub no longer accepts themacos-14label). The DUB package name is unchanged. == Open questions -
The exact region and subregion list and each language’s membership (IL-6).
-
Where
tr-TRgoes in the region list, and what to do with the big Other group (IL-6). Raised by the open-shell v0.2.0 implementation. -
How a click is routed back to the shell in terminals that hand OSC 8 targets to the OS (IL-8). open-shell v0.2.0 emits
oso-langlinks where the terminal can draw the globe; how an OSC 8 click returns to the shell is still open. -
The plain-text form of the indicator, and how the shell detects a terminal without the globe (IL-7). Whether
[code], which open-shell v0.2.0 prints, stays the plain-text globe fallback. -
Whether
lang <code>persists beyond the session (IL-12), and in particular whether it persists to the user config. -
Which tokens are localizable (IL-13).
-
Whether a click-run
langis added to history, and what the restored buffer does with words of the previous language (IL-10). -
Whether a user alias
lmay shadow the declared aliasL. Windows is case-insensitive, so a userlcollides withLthere, and Linux often aliasesl(commonly tols). Proposed: the user alias wins and the shell says so once. -
Whether
.codeset/@modifiersuffixes are stripped instead of rejected (IL-3). -
Whether
langand-langshould be renamed apart. The names are decided; the confusion risk is flagged, not resolved.
Conformance checklist
-
langandLexist, are registered at the namespace root, and behave identically (IL-1). -
langtakes only a region keyword, a code or a number, never a word likelistorall(IL-2). -
BCP 47,
en_us-style and hyphenless codes are accepted case-insensitively and normalized to BCP 47;.codesetis rejected (IL-3). -
The build fails on a key collision between locales, region keywords, canonical tokens or pack words (IL-4).
-
A language with only regional packs gets the disambiguation response, exit
2(IL-5). -
langprints regions;lang <region>narrows (IL-6). -
The preamble shows
on every prompt, with no flag emoji and no<code>
NAME=form (IL-7). -
Where OSC 8 is available, the indicator and each listed entry are clickable and a click runs only
langwith a shell-generated argument; elsewhere the numbered menu is shown (IL-8, IL-9). -
A click preserves and restores the command line, on success and on failure (IL-10).
-
Typing
langorLshows the explanatory hint (IL-11). -
The input language is not exported and does not touch
LANGorLC_*(IL-12). -
Canonical English tokens work in every input language; scripts are saved and read with canonical tokens only (IL-13, IL-14).
-
Errors use the table above and exit
2or1as stated.
Shell icon
Status: shipped. The icon first shipped in open-shell v0.2.0unchecked. open-shell v0.2.1unchecked (2026-12-05) fixed the Windows Terminal packaging under the old open-shell names. plush v0.3.0unchecked renamed the files to plush; plush v0.3.1unchecked (2026-12-06) is the current release and fixes the fragment install script. Every file below is in the plushunchecked repository, and the links point at the v0.3.1 tag so they do not move when main changes. Paths and release assets at this tag use the plush name. Every path below was checked against the tag on 2026-12-06.
The drawing is a rounded dark tile (a vertical gradient from #12233A to #0B1526) carrying two nested crescents (a cyan gradient from #00D2FF to #009DD8, and a darker teal, #0486A8), a light chevron prompt (#F4F7FB to #DCE5F0) and a red block cursor (#FF3131).
| Asset | File at the tag | What it is for |
|---|---|---|
Master drawing |
|
The full-colour mark on its tile, 256 by 256. The source for the raster files. |
Mark |
|
The same drawing as the master (the two files are identical at this tag), kept with the other isolated drawings. |
Glyph |
|
The crescents, chevron and block without the tile (176 by 168), for placing on a background of your own. |
Mono glyph |
|
One colour: it is filled with |
Windows icon |
|
The source of truth for the icon file. One |
PNG set |
|
Raster copies, all in |
Windows Terminal profile |
A profile fragment that adds a profile named "Plus Shell" with the icon (see below). |
|
Terminal fragment icon |
|
The |
Fragment zip |
|
The JSON and the icon at the root of the archive (two files), for placing by hand. |
Install script |
Run from a repository checkout: syncs the icon, then installs both files into |
Embedded executable icon. source/windows/plush.rcunchecked is the single line 1 ICON "..\\..\\assets\\plush.ico", so the Windows executables embed assets/plush.ico as their icon. The same drawing was confirmed in the open-shell Windows executables of v0.2.0 and v0.2.1 on 2026-12-05. The v0.3.1 release assets are plush-windows-x64.exe and plush-windows-arm64.exe, next to plush-linux-x64, plush-linux-arm64, plush-macos-arm64, plush.bin and plush-windows-terminal-fragment.zip.
Windows Terminal profile. The fragment at the tag is exactly this:
{
"profiles": [
{
"name": "Plus Shell",
"commandline": "plush",
"icon": "plush.ico",
"startingDirectory": "%USERPROFILE%"
}
]
}
The icon value is a bare file name, which names the plush.ico beside the JSON. The packaging/windows-terminal/ folder ships both files, so nothing has to be copied by hand. assets/plush.ico stays the source of truth: tools/sync-fragment-icon.ps1 copies it into the folder, and the CI step "Fragment icon matches assets" (cmp -s on the two files) fails the build if they differ. There are two ways to install it:
-
From the release. Download
plush-windows-terminal-fragment.zipfrom v0.3.1unchecked. It holdsplush.jsonandplush.icoat its root. Put both files together in a folder of their own under the Windows Terminal Fragments folder. -
From a checkout. Run
tools/install-windows-terminal-fragment.ps1. It syncs the icon, then copies both files into%LOCALAPPDATA%\Microsoft\Windows Terminal\Fragments\FreeCLI\. In v0.3.0 the script could exit before that copy, because a missing$LASTEXITCODEafter the icon sync was treated as failure; v0.3.1 continues in that case. The script also removes an oldFragments\OpenShellOrg\copy left by releases through v0.2.1. The script is not in the zip: it finds the files relative to its own location in the repository. == See also -
CH-29, the
-langoutput-language switch, CH-27, help modes, CH-28, compatibility page -
Schema-first CLI syntax seedunchecked (design record, decision 20)