Problem
When SSH’ing from Ghostty terminal emulator to RHEL 8.10 and Nutanix CVMs, the Return key behaved unexpectedly:
- Pressing Return added a visual space character
- The last character typed was deleted (e.g., ’s’ in ’ls')
- A second Return press was needed to send the incomplete command
Example:
[user@host ~]# ls
[user@host ~]# l # Character deleted, space added
[user@host ~]# bash: l: command not found
This issue only occurred on RHEL 8.10 and Nutanix CVMs. Other systems (RHEL 9.4, RHEL 7.9, Ubuntu 24.04, Debian 13) worked perfectly fine.
Root Cause
The issue was a terminal type incompatibility between Ghostty and RHEL 8.10’s terminfo database.
What happens:
- Ghostty advertises itself as
TERM=xterm-ghosttywhen connecting via SSH - RHEL 8.10’s terminfo database doesn’t have a definition for
xterm-ghostty, so it falls back to a generic or incompatible terminal type - This fallback causes readline (bash’s line editing library) to misinterpret the Return key escape sequence as a backspace command
- Newer systems (RHEL 9.4+, Ubuntu 24.04, Debian 13) have updated terminfo databases that handle
xterm-ghosttycorrectly, or have better fallback behavior
Solution
The fix is simple: force the terminal type to linux, which has a stable, widely-compatible escape sequence set.
Option 1: SSH Config (Recommended - Client-side)
Edit or create ~/.ssh/config and add:
Host *
SetEnv TERM=linux
This applies the fix to all SSH connections without requiring changes on any servers.
Advantages:
- One-time setup
- No server changes needed
- Works with any terminal emulator (not just Ghostty)
- Survives Ghostty updates
Option 2: Server-side (If SSH config not available)
Add to ~/.bashrc on affected servers:
export TERM=linux
This forces the shell to use the linux terminal type on each login.
Verification
After applying the fix, SSH back to your RHEL 8.10 or Nutanix system:
ssh root@your-rhel-8-system
Type a command and press Return - it should now execute normally without the delete/space behavior:
[root@host ~]# ls
anaconda-ks.cfg Desktop Documents Downloads
[root@host ~]# pwd
/root
[root@host ~]#
Why TERM=linux Works
The linux terminal type:
- Uses simpler, more stable escape sequences
- Is compatible across all RHEL/Linux versions
- Works perfectly with Ghostty’s implementation
- Does not break any functionality
The xterm-ghostty definition is not available in RHEL 8.10’s terminfo database, so it either falls back to a generic type or uses an incompatible definition, causing readline to misinterpret Return as Backspace.
Alternative: Ghostty Configuration
Ghostty doesn’t currently have a built-in config option to change the TERM announcement (it’s hardcoded to xterm-ghostty). However, the SSH config method above provides a clean, terminal-agnostic solution.
If you want a Ghostty-specific approach, you would need to:
- Modify Ghostty’s source code to support TERM override (not practical)
- Use SSH config (recommended)
- Apply server-side fixes
Summary
| Approach | Pros | Cons |
|---|---|---|
| SSH Config | One-time setup, applies globally, no server changes | None |
| Server-side ~/.bashrc | Works if SSH config unavailable | Requires changes on each server |
| Ghostty config | Would be terminal-centric | Not currently supported |
Recommended: Use SSH config - it’s the most elegant and centralized solution.
Additional Notes
- This issue is specific to RHEL 8.10 and Nutanix CVMs (which likely run RHEL 8.x)
- RHEL 7.9 and RHEL 9.4+ do not have this issue
- The fix applies globally to all SSH connections, not just Ghostty
- The
linuxterminal type is widely supported and stable across all Linux distributions