[codex] Preserve Ghostty terminal behavior over SSH#11
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ssh-envandssh-terminfoshell-integration features.Why
Direct SSH from Ghostty can expose
TERM=xterm-ghosttyto 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 totmux-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-batsmake lintNot tested