Skill Tracer
Skills › Scientific Agent Skills › pi-agent › terminal-setup.md

terminal-setup.md

89 lines · skills/pi-agent/references/terminal-setup.md at 5f2bc03

Open on GitHub
1# Terminal Setup
2
3Source: https://pi.dev/docs/latest/terminal-setup
4
5Reviewed against Pi 0.99.2 and the package versions listed in `../SKILL.md` on 2026-09-30.
6
7Pi uses the [Kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/) for reliable modifier detection. Most modern terminals support it; some need configuration.
8

Terminal Setup

Source: https://pi.dev/docs/latest/terminal-setup

Reviewed against Pi 0.99.2 and the package versions listed in ../SKILL.md on 2026-09-30.

Pi uses the Kitty keyboard protocol for reliable modifier detection. Most modern terminals support it; some need configuration.

Raw lines 1 to 8
9## Works Out of the Box
11Kitty and iTerm2 (regular TUI mode). Apple Terminal enables enhanced key reporting when available; if it still sends plain Return for `Shift+Enter`, Pi uses a local macOS modifier fallback — which only works when Pi runs on the same Mac, not over SSH. VS Code 1.109.5+ also works by default.

Works Out of the Box

Kitty and iTerm2 (regular TUI mode). Apple Terminal enables enhanced key reporting when available; if it still sends plain Return for Shift+Enter, Pi uses a local macOS modifier fallback — which only works when Pi runs on the same Mac, not over SSH. VS Code 1.109.5+ also works by default.

Raw lines 9 to 12
13### iTerm2 in fullscreen TUI mode
15Pi owns the viewport, so iTerm2 sends mouse-wheel reports instead of scrolling its native scrollback. With iTerm2's default fast-trackpad behavior those reports can lose most of an accelerated wheel delta. If fast gestures move only ~one line at a time, open **iTerm2 → Settings → Advanced**, find **Trackpad scrolls fast?** and set it to **No**. This is an iTerm2-wide workaround (tracked in iTerm2 issue 9619). Inline images also render as text placeholders in fullscreen mode because iTerm2's inline-image protocol cannot delete or crop placements during application-owned scrolling.

iTerm2 in fullscreen TUI mode

Pi owns the viewport, so iTerm2 sends mouse-wheel reports instead of scrolling its native scrollback. With iTerm2's default fast-trackpad behavior those reports can lose most of an accelerated wheel delta. If fast gestures move only ~one line at a time, open iTerm2 → Settings → Advanced, find Trackpad scrolls fast? and set it to No. This is an iTerm2-wide workaround (tracked in iTerm2 issue 9619). Inline images also render as text placeholders in fullscreen mode because iTerm2's inline-image protocol cannot delete or crop placements during application-owned scrolling.

Raw lines 13 to 16
17## Ghostty
19Config at `~/Library/Application Support/com.mitchellh.ghostty/config` (macOS) or `~/.config/ghostty/config` (Linux):
21```text
22keybind = alt+backspace=text:\x1b\x7f
23```
25Older Claude Code versions may have added `keybind = shift+enter=text:\n`. That sends a raw linefeed, which inside Pi is indistinguishable from `Ctrl+J`, so tmux and Pi no longer see a real `shift+enter` event. Remove it unless you still need it for Claude Code in tmux. Pi binds `Ctrl+J` as a default newline alias, so `Shift+Enter` keeps working through that remap without extra Pi configuration.
27In fullscreen TUI mode links stay clickable, but Ghostty hides its hover underline and lower-left URL preview while Pi captures mouse input. Hold `Shift+Command` (macOS) or `Shift+Ctrl` (Linux) for Ghostty's native link handling.

Ghostty

Config at ~/Library/Application Support/com.mitchellh.ghostty/config (macOS) or ~/.config/ghostty/config (Linux):

keybind = alt+backspace=text:\x1b\x7f

Older Claude Code versions may have added keybind = shift+enter=text:\n. That sends a raw linefeed, which inside Pi is indistinguishable from Ctrl+J, so tmux and Pi no longer see a real shift+enter event. Remove it unless you still need it for Claude Code in tmux. Pi binds Ctrl+J as a default newline alias, so Shift+Enter keeps working through that remap without extra Pi configuration.

In fullscreen TUI mode links stay clickable, but Ghostty hides its hover underline and lower-left URL preview while Pi captures mouse input. Hold Shift+Command (macOS) or Shift+Ctrl (Linux) for Ghostty's native link handling.

Raw lines 17 to 28
29## WezTerm
31Usually works via xterm `modifyOtherKeys`. To force the Kitty protocol, in `~/.wezterm.lua`:
33```lua
34local wezterm = require 'wezterm'
35local config = wezterm.config_builder()
36config.enable_kitty_keyboard = true
37return config
38```
40On macOS `Option+Enter` is bound to fullscreen; to use it for follow-up queueing add to `config.keys`:
42```lua
43{ key = 'Enter', mods = 'ALT', action = wezterm.action.SendString('\x1b[13;3u') }
44```
46On WSL, WezTerm may need a visible hardware cursor for IME candidate positioning — set `PI_HARDWARE_CURSOR=1` or `showHardwareCursor: true`.

WezTerm

Usually works via xterm modifyOtherKeys. To force the Kitty protocol, in ~/.wezterm.lua:

local wezterm = require 'wezterm'
local config = wezterm.config_builder()
config.enable_kitty_keyboard = true
return config

On macOS Option+Enter is bound to fullscreen; to use it for follow-up queueing add to config.keys:

{ key = 'Enter', mods = 'ALT', action = wezterm.action.SendString('\x1b[13;3u') }

On WSL, WezTerm may need a visible hardware cursor for IME candidate positioning — set PI_HARDWARE_CURSOR=1 or showHardwareCursor: true.

Raw lines 29 to 47
48## Alacritty
50Usually works for `Shift+Enter`. On macOS `Option+Enter` may arrive as plain `Enter`; add to `~/.config/alacritty/alacritty.toml` and restart:
52```toml
53[[keyboard.bindings]]
54key = "Enter"
55mods = "Alt"
56chars = "\u001b[13;3u"
57```

Alacritty

Usually works for Shift+Enter. On macOS Option+Enter may arrive as plain Enter; add to ~/.config/alacritty/alacritty.toml and restart:

[[keyboard.bindings]]
key = "Enter"
mods = "Alt"
chars = "\u001b[13;3u"
Raw lines 48 to 58
59## VS Code Integrated Terminal
611.109.5+ enables the Kitty protocol by default. Older versions need an explicit `keybindings.json` entry (macOS `~/Library/Application Support/Code/User/keybindings.json`, Linux `~/.config/Code/User/keybindings.json`, Windows `%APPDATA%\Code\User\keybindings.json`):
63```json
65 "key": "shift+enter",
66 "command": "workbench.action.terminal.sendSequence",
67 "args": { "text": "\u001b[13;2u" },
68 "when": "terminalFocus"
70```

VS Code Integrated Terminal

1.109.5+ enables the Kitty protocol by default. Older versions need an explicit keybindings.json entry (macOS ~/Library/Application Support/Code/User/keybindings.json, Linux ~/.config/Code/User/keybindings.json, Windows %APPDATA%\Code\User\keybindings.json):

{
  "key": "shift+enter",
  "command": "workbench.action.terminal.sendSequence",
  "args": { "text": "\u001b[13;2u" },
  "when": "terminalFocus"
}
Raw lines 59 to 71
72## Windows Terminal
74Add to `settings.json` (Ctrl+Shift+, then Open JSON file) so the modified Enter keys reach Pi:
76```json
78 "actions": [
79 { "command": { "action": "sendInput", "input": "\u001b[13;2u" }, "keys": "shift+enter" },
80 { "command": { "action": "sendInput", "input": "\u001b[13;3u" }, "keys": "alt+enter" }
81 ]
83```
85Windows/WSL now use Ctrl+Q for follow-up by default. Windows Terminal binds `Alt+Enter` to fullscreen; the optional remap above is useful only when you also bind Pi follow-up to Alt+Enter. Fully close and reopen Windows Terminal if the old fullscreen behavior persists.

Windows Terminal

Add to settings.json (Ctrl+Shift+, then Open JSON file) so the modified Enter keys reach Pi:

{
  "actions": [
    { "command": { "action": "sendInput", "input": "\u001b[13;2u" }, "keys": "shift+enter" },
    { "command": { "action": "sendInput", "input": "\u001b[13;3u" }, "keys": "alt+enter" }
  ]
}

Windows/WSL now use Ctrl+Q for follow-up by default. Windows Terminal binds Alt+Enter to fullscreen; the optional remap above is useful only when you also bind Pi follow-up to Alt+Enter. Fully close and reopen Windows Terminal if the old fullscreen behavior persists.

Raw lines 72 to 86
87## Limited Terminals
89xfce4-terminal, terminator, and IntelliJ IDEA's integrated terminal cannot distinguish modified Enter keys from plain Enter, so bindings such as `submit: ["ctrl+enter"]` will not work. Prefer a terminal with Kitty keyboard support: Kitty, Ghostty, WezTerm, iTerm2, or Alacritty compiled with Kitty protocol support. In IntelliJ, set `PI_HARDWARE_CURSOR=1` if you want the hardware cursor visible (off by default for compatibility).

Limited Terminals

xfce4-terminal, terminator, and IntelliJ IDEA's integrated terminal cannot distinguish modified Enter keys from plain Enter, so bindings such as submit: ["ctrl+enter"] will not work. Prefer a terminal with Kitty keyboard support: Kitty, Ghostty, WezTerm, iTerm2, or Alacritty compiled with Kitty protocol support. In IntelliJ, set PI_HARDWARE_CURSOR=1 if you want the hardware cursor visible (off by default for compatibility).

Raw lines 87 to 89