Skip to content

Add support for the Ghostty terminal#47

Open
ndeloof wants to merge 1 commit into
eiannone:masterfrom
ndeloof:ghostty-support
Open

Add support for the Ghostty terminal#47
ndeloof wants to merge 1 commit into
eiannone:masterfrom
ndeloof:ghostty-support

Conversation

@ndeloof

@ndeloof ndeloof commented Jul 16, 2026

Copy link
Copy Markdown

Ghostty sets TERM=xterm-ghostty (and, on macOS, TERMINFO pointing to its bundled terminfo). That terminfo describes special keys in keypad transmit mode (kcuu1=\EOA, khome=\EOH, …), but this library never emits smkx, so the terminal actually sends the normal-mode sequences (\E[A, \E[H, …) and every arrow/function key comes back as an unrecognized escape sequence.

This treats xterm-ghostty like xterm/xterm-256color: use the built-in xterm key table instead of the terminfo entry, which matches what Ghostty emits in normal mode. Also adds a ghostty entry to the compatibility table as a fallback.

🤖 Generated with Claude Code

Ghostty sets TERM=xterm-ghostty and (on macOS) TERMINFO pointing to its
bundled terminfo. That terminfo describes keys in keypad transmit mode
(kcuu1=\EOA, khome=\EOH, ...), but this library never emits smkx, so
the terminal actually sends the normal-mode sequences (\E[A, \E[H, ...)
and every special key is reported as an unrecognized escape sequence.

Treat xterm-ghostty like xterm/xterm-256color: use the built-in xterm
key table instead of the terminfo entry, which matches what Ghostty
emits in normal mode.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant