OpenProgram Docs

Terminal setup

  1. DetectTERM_PROGRAM, WT_SESSION, editor variables, or --terminal
  2. Planreads only; lists each file and the entry
  3. the person runs it again with apply
  4. Back up and write<file>.openprogram-backup-<time> beside the file
  5. Undo linethe copy command that restores it

Code: host/terminal_setup.py; CLI interfaces/cli/commands/maintenance/terminal_setup.py; shared command runtime/commands/terminal_setup.py, registered in runtime/commands/registry.py; the TUI case in apps/cli/src/commands/handler.ts; the default binding in apps/cli/src/keybindings/table.ts. Tests: tests/component/platform/test_terminal_setup.py, each under a temporary HOME. User page: TUI.

Per terminal

TerminalWhat changes
iTerm2, Ghostty, WezTerm, KittyNothing. The TUI turns on the kitty keyboard protocol there, and they report Shift+Enter as ESC [ 13 ; 2 u
VS Code, Insiders, Cursor, WindsurfThe user keybindings.json gets shift+enter → workbench.action.terminal.sendSequence with that sequence, when: terminalFocus. Inside a Remote-SSH terminal the file is on the other machine, so it says to run it locally
Windows TerminalA sendInput action in settings.json (packaged, preview or unpackaged path); an actions array is added when there is none
AlacrittyA [[keyboard.bindings]] entry in alacritty.toml, checked with tomllib. A legacy YAML config is reported, not converted
Terminal.appIt cannot tell Shift+Enter from Enter. "Use Option as Meta key" in the default profile, through defaults export and import with a backup plist, makes Option+Enter the new-line key
Inside tmuxA note with the two tmux.conf lines that pass the key through. tmux's file is not written

Rules

PartRule
Only on requestNothing calls it on start or on a key. Without apply it only reads
RefusalA file that does not parse, or already binds Shift+Enter in the terminal to something else, is left untouched with the reason. A binding scoped to the editor only does not count
Comments keptJSONC files get the entry inserted as text after the array's opening bracket, then reparsed to check; the file is never re-serialized
WriteAtomic replace through a temporary file in the same folder; a symlinked file is written at its target
Already setReports it is configured and writes nothing
Where it runsThe TUI runs the CLI with its own environment (OPENPROGRAM_CLI_PYTHON), so detection sees the terminal the TUI is in. The shared command on the Worker uses the session's terminal environment when the CLI gives one, and otherwise says to run it in the terminal

Why this shape

PeerWhat it does, and what we take
Copilot CLI/terminal-setup writes the VS Code sendSequence and Windows Terminal sendInput bindings, refuses on a conflict or invalid JSON, keeps a backup. Taken as is
Claude CodeLists the changes first, sets Option as Meta in Terminal.app, names the tmux settings, leaves native terminals alone. Taken; the list is a separate step here, so writing always follows a list the person saw
Pidocs/terminal-setup.md gives the same \u001b[13;2u sequence for manual setup. The same sequence keeps one key path in the TUI

Implementation status

Not configured: Warp, JetBrains terminals, GNOME Terminal and Konsole are not recognised; the command says Alt+Enter adds a new line in any terminal and lists the supported names for --terminal.

Last updated · 2026-11-30