Skip to content

[codex] Preserve Ghostty terminal behavior over SSH#11

Merged
gsantovena merged 1 commit into
mainfrom
codex/ghostty-ssh-terminfo
May 12, 2026
Merged

[codex] Preserve Ghostty terminal behavior over SSH#11
gsantovena merged 1 commit into
mainfrom
codex/ghostty-ssh-terminfo

Conversation

@gsantovena

Copy link
Copy Markdown
Owner

Summary

  • Enable Ghostty ssh-env and ssh-terminfo shell-integration features.
  • Add a Bats regression check so the SSH terminal compatibility helpers remain enabled.

Why

Direct SSH from Ghostty can expose TERM=xterm-ghostty to a remote macOS host that does not know Ghostty's terminfo. That can make zsh/oh-my-posh redraw incorrectly, producing doubled or weird letters. Starting tmux first masks the issue because tmux changes the advertised terminal to tmux-256color.

Impact

Ghostty can now install its terminfo on SSH targets when possible, and use safer SSH terminal environment behavior when needed, while preserving Ghostty-specific capabilities for hosts that support them.

Validation

  • ghostty +validate-config --config-file="$PWD/config/ghostty/config"
  • bats tests/test_dotfiles.bats --filter 'ghostty|SSH terminal compatibility'
  • make test-bats
  • make lint

Not tested

  • Manual SSH reproduction from the other Mac; user will validate that path.

Ghostty advertises xterm-ghostty locally, but remote macOS hosts may not know that terminfo entry. Enabling Ghostty's SSH environment and terminfo helpers lets SSH sessions either install the richer entry or fall back safely instead of leaving zsh and oh-my-posh to redraw against mismatched capabilities.

Constraint: The bug reproduces only in direct Ghostty SSH sessions; tmux masks it by changing TERM to tmux-256color.

Rejected: Force term = xterm-256color | would avoid the remote mismatch but discard Ghostty-specific capabilities locally and in tmux-aware flows.

Confidence: medium

Scope-risk: narrow

Directive: Keep ssh-env and ssh-terminfo paired unless verifying direct Ghostty-to-macOS SSH prompt redraw behavior.

Tested: ghostty +validate-config --config-file=config/ghostty/config

Tested: bats tests/test_dotfiles.bats --filter 'ghostty|SSH terminal compatibility'

Tested: make test-bats

Tested: make lint

Not-tested: Manual SSH reproduction from the second Mac
@gsantovena gsantovena marked this pull request as ready for review May 12, 2026 02:38
@gsantovena gsantovena merged commit 797623d into main May 12, 2026
5 checks passed
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