Pi works inside tmux, but tmux strips modifier information from certain keys by default. Without configuration, Shift+Enter and Ctrl+Enter are usually indistinguishable from plain Enter.
Add to ~/.tmux.conf:
set -g extended-keys on
set -g extended-keys-format csi-uThen restart tmux fully:
tmux kill-server
tmuxPi requests extended key reporting automatically when Kitty keyboard protocol is not available. With extended-keys-format csi-u, tmux forwards modified keys in CSI-u format, which is the most reliable configuration.
With only:
set -g extended-keys ontmux defaults to extended-keys-format xterm. When an application requests extended key reporting, modified keys are forwarded in xterm modifyOtherKeys format such as:
Ctrl+C→\x1b[27;5;99~Ctrl+D→\x1b[27;5;100~Ctrl+Enter→\x1b[27;5;13~
With extended-keys-format csi-u, the same keys are forwarded as:
Ctrl+C→\x1b[99;5uCtrl+D→\x1b[100;5uCtrl+Enter→\x1b[13;5u
Pi supports both formats, but csi-u is the recommended tmux setup.
Without tmux extended keys, modified Enter keys collapse to legacy sequences:
| Key | Without extkeys | With csi-u |
|---|---|---|
| Enter | \r |
\r |
| Shift+Enter | \r |
\x1b[13;2u |
| Ctrl+Enter | \r |
\x1b[13;5u |
| Alt/Option+Enter | \x1b\r |
\x1b[13;3u |
This affects the default keybindings (Enter to submit, Shift+Enter for newline) and any custom keybindings using modified Enter.
- tmux 3.2 or later (run
tmux -Vto check) - A terminal emulator that supports extended keys (Ghostty, Kitty, iTerm2, WezTerm, Windows Terminal)