Source: ViewEdit

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 14 (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 (help, and, or, not, and other localizable words, [il-tokens]).

The language a tool or help system answers in.

Set by

The lang command (alias L), or a shell setting ([il-setting]).

-lang <code> on the command line (CH-29), else the OS locale, else English.

Scope

The shell session. Never exported to child processes.

One invocation.

Spelled

lang, L: a shell command (a bare-word node, NS-15 token kinds).

-lang: a switch (NS-15).

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 register L as a declared alias of it (an alias node, NS-1, pointing at lang). 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

lang

Prints the current input language (globe_with_meridians en-US) and the condensed region list ([il-regions]). Changes nothing.

0

lang <region>

Narrows: prints the languages in that region (or its subregions, [il-regions]) and how to pick one. Changes nothing.

0

lang <code>

Sets the input language for the session ([il-setting]) and prints the new globe_with_meridians <code>.

0

lang <number>

Picks entry n of the list printed by the previous lang call in this session (used by the numbered menu, [il-menu]). PROPOSED.

0

L, L <region>, L <code>, L <number>

Identical to the same invocation of lang.

as lang

lang -help, lang help/i

Help for lang, as for any command (CH-27). The help MUST say that -lang is the output language.

0

IL-2

lang accepts no subcommand words. A word such as list, all, set or none would also be a valid hyphenless language code (measured against the IANA Language Subtag Registry, File-Date 2026-11-30: list parses as li + ST, none as no + NE, all and set are ISO 639-3 languages), so every argument of lang is 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 accepts en_us as 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.

Table 1. Hyphenless parse
Letters in the alphabetic run Read as Example

2 or 3

language

es, fil

4

language (2) + region (2)

enus is en-US

5

language (3) + region (2)

filph is fil-PH

6

language (2) + script (4)

zhhant is zh-Hant

7

language (3) + script (4)

yuehant is yue-Hant

8

language (2) + script (4) + region (2)

zhhanthk is zh-Hant-HK

9

language (3) + script (4) + region (2)

yuehanthk is yue-Hant-HK

any of the above followed by exactly 3 digits

the same, with a 3-digit region

es419 is es-419, zhhant419 would be zh-Hant-419

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:

  1. Two different canonical locales normalize to the same lower-case, separator-free key (for example if an alias list maps enus to two packs).

  2. 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]).

  3. 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 en with only en-US and en-GB installed), the shell MUST NOT pick one. It prints a disambiguation response on stderr listing each candidate with its hyphenless spelling, changes nothing, and exits 2:

error: 'en' has regional variants; pick one
  en-US : enus
  en-GB : engb
  see: lang -help

This is not prefix matching: lang en is the exact language code en, and it resolves only if a pack for exactly en exists.

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 example western-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, caribbean or western-africa parses 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 (globe_with_meridians), 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 other NAME=value form, 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 lang runs.

    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 same lang invocation the text names: clicking the preamble runs lang; clicking africa runs lang africa, which narrows the list; clicking a language runs lang <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 lang with 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 run lang with an arbitrary argument.

PROPOSED: the link target is a URI in the reserved scheme oso-lang: whose path is the argument (oso-lang: for bare lang, 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.

The numbered-menu fallback

IL-9

DECIDED. Where hyperlinks are not available (conhost, or detection finds none), lang MUST print a numbered menu, and the user picks by typing the command again. PROPOSED details: entries are numbered from 1 in the order shown; lang <number> picks an entry of the list printed by the previous lang call in the same session; a number with no previous list, or past the end, is a usage error (exit 2); lang MUST NOT block waiting for a key, because it must stay usable with redirected input.

$ lang
Input language: 🌐 en-US
  1  africa
  2  americas
  3  asia
  4  europe
  5  oceania
Type: lang <region|code>, or lang <number> to pick from this list.
$ lang 4
Europe:
  1  bg      2  ca      3  cs      4  da      5  de
  6  el      7  en-GB    8  es      9  fi     10  fr
Type: lang <code>, or lang <number> to pick from this list.

(Illustrative lists; the real entries come from the installed packs.)

Keeping the command line

IL-10

DECIDED. When lang runs 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), run lang, print its output, then put the buffer back at the next prompt, unchanged and not executed. This holds when lang succeeds and when it fails.

Prior art: zsh’s push-line, push-input and push-line-or-edit widgets push the current buffer onto a stack and pop it back at the next prompt (zshzle; get-line is the counterpart). fish and bash/readline have no stock equivalent (fish users write a function around commandline; readline users fall back to Ctrl+U and Ctrl+Y). PSReadLine has no stock widget by that name; a Set-PSReadLineKeyHandler script block can stash and restore the buffer with GetBufferState and Insert (see the custom key bindings section of about_PSReadLine).

Two sub-questions are OPEN: (a) whether the click-run lang call 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 lang when the user types lang or L. 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 POSIX LANG or LC_* variables, because those select a tool’s output locale. Whether lang <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 ayuda to help). 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, not and 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

lang xx (not a region, code or number)

error: unknown language or region 'xx', then ` did you mean: …​` when one is close, then ` see: lang -help`

2

lang en with only regional packs

The disambiguation response of IL-5.

2

lang fr-CA, a valid code with no installed pack

error: no input-language pack for 'fr-CA', then ` installed: de, en-GB, en-US, es` (shortened), then ` see: lang -help`

1

lang en_US.UTF-8

error: invalid language code 'en_US.UTF-8': no codeset or modifier, then ` write: en_us, en-US or enus`

2

lang 7 with no list or past its end

error: no entry 7 in the last list, then ` see: lang`

2

lang africa asia, or any second argument

error: unexpected argument 'asia', then ` see: lang -help`

2

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.1 (2026-12-06) is the current release. The rename from open-shell landed in plush v0.3.0 (plush#1, 59c6dd3): the command, the DUB package plush (0.3.0 and 0.3.1), the release files, the Windows Terminal fragment, and the shim package freecli.plush (commands plush and osh) all use the new name. v0.3.1 (commit a10fd5b) fixes tools/install-windows-terminal-fragment.ps1, which in v0.3.0 could exit before copying plush.json and plush.ico into Fragments\FreeCLI\. The oso syntax mode, the oso-lang: link scheme, the +oso1.0.0 build-metadata prefix, the OSO_* environment variables, and osh-shim are unchanged.

  • The input-language behaviour described next was released in open-shell v0.2.0: help for the shell and for lang comes from prohelp, and -h and --help still open help. The input-language command follows this page: the globe and code, a numbered list, and oso-lang links where the terminal can draw the globe (the v0.2.0 release notes). open-shell v0.2.1 (2026-12-05) fixed the Windows Terminal packaging under the old open-shell file names.

  • prohelp v0.3.2 is current (prohelp#2; URL and text updates for FreeCLI; also on DUB). The alignment with CH-27, CH-28 and CH-29 landed in prohelp v0.3.1.

  • langcodes v0.1.1: BCP 47 language tags, normalization and hyphenless collision checks for D (IL-3, IL-4). The DUB package name is unchanged.

  • command-namespace main at f5202f5: the CI macOS job runs on macos-latest (GitHub no longer accepts the macos-14 label). The DUB package name is unchanged. == Open questions

  • The exact region and subregion list and each language’s membership (IL-6).

  • Where tr-TR goes 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-lang links 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 lang is added to history, and what the restored buffer does with words of the previous language (IL-10).

  • Whether a user alias l may shadow the declared alias L. Windows is case-insensitive, so a user l collides with L there, and Linux often aliases l (commonly to ls). Proposed: the user alias wins and the shell says so once.

  • Whether .codeset / @modifier suffixes are stripped instead of rejected (IL-3).

  • Whether lang and -lang should be renamed apart. The names are decided; the confusion risk is flagged, not resolved.

Conformance checklist

  • lang and L exist, are registered at the namespace root, and behave identically (IL-1).

  • lang takes only a region keyword, a code or a number, never a word like list or all (IL-2).

  • BCP 47, en_us-style and hyphenless codes are accepted case-insensitively and normalized to BCP 47; .codeset is 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).

  • lang prints regions; lang <region> narrows (IL-6).

  • The preamble shows globe_with_meridians <code> on every prompt, with no flag emoji and no NAME= form (IL-7).

  • Where OSC 8 is available, the indicator and each listed entry are clickable and a click runs only lang with 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 lang or L shows the explanatory hint (IL-11).

  • The input language is not exported and does not touch LANG or LC_* (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 2 or 1 as stated.

Shell icon

Status: shipped. The icon first shipped in open-shell v0.2.0. open-shell v0.2.1 (2026-12-05) fixed the Windows Terminal packaging under the old open-shell names. plush v0.3.0 renamed the files to plush; plush v0.3.1 (2026-12-06) is the current release and fixes the fragment install script. Every file below is in the plush 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).

Table 2. Icon assets in plush v0.3.1
Asset File at the tag What it is for

Master drawing

assets/plush.svg

The full-colour mark on its tile, 256 by 256. The source for the raster files.

Mark

assets/icons/plush-mark.svg

The same drawing as the master (the two files are identical at this tag), kept with the other isolated drawings.

Glyph

assets/icons/plush-glyph.svg

The crescents, chevron and block without the tile (176 by 168), for placing on a background of your own.

Mono glyph

assets/icons/plush-glyph-mono.svg

One colour: it is filled with currentColor, so the surrounding text colour paints it, and the chevron and block are cut into the same single shape. For interfaces that theme their icons.

Windows icon

assets/plush.ico

The source of truth for the icon file. One .ico holding seven 32-bit sizes: 16, 24, 32, 48, 64, 128 and 256 px. The range stops at 256 px on purpose: the 512 px drawing is PNG only (a comment in tools/sync-fragment-icon.ps1 says so). The Windows executables embed this file.

PNG set

plush-16.png, 24, 32, 48, 64, 128, 256 and 512

Raster copies, all in assets/png/, for places that take PNG, such as launchers, package metadata and web pages. Only this set reaches 512 px, by design.

Windows Terminal profile

packaging/windows-terminal/plush.json

A profile fragment that adds a profile named "Plus Shell" with the icon (see below).

Terminal fragment icon

packaging/windows-terminal/plush.ico

The .ico beside the JSON, so the fragment’s bare icon name resolves. It is a copy of assets/plush.ico (byte-identical at this tag), synced by tools/sync-fragment-icon.ps1. CI fails if the two differ.

Fragment zip

plush-windows-terminal-fragment.zip, a release asset of v0.3.1

The JSON and the icon at the root of the archive (two files), for placing by hand.

Install script

tools/install-windows-terminal-fragment.ps1

Run from a repository checkout: syncs the icon, then installs both files into %LOCALAPPDATA%\Microsoft\Windows Terminal\Fragments\FreeCLI\.

Embedded executable icon. source/windows/plush.rc 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.zip from v0.3.1. It holds plush.json and plush.ico at 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 $LASTEXITCODE after the icon sync was treated as failure; v0.3.1 continues in that case. The script also removes an old Fragments\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 -lang output-language switch, CH-27, help modes, CH-28, compatibility page

  • NS-15, the slash namespace separator

  • Schema-first CLI syntax seed (design record, decision 20)