Skip to main content

Fixing Ghostty Return Key Issue on RHEL 8.10 and Nutanix CVMs

Problem

When SSH’ing from Ghostty terminal emulator to RHEL 8.10 and Nutanix CVMs, the Return key behaved unexpectedly:

  1. Pressing Return added a visual space character
  2. The last character typed was deleted (e.g., ’s’ in ’ls')
  3. 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:

  1. Ghostty advertises itself as TERM=xterm-ghostty when connecting via SSH
  2. 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
  3. This fallback causes readline (bash’s line editing library) to misinterpret the Return key escape sequence as a backspace command
  4. Newer systems (RHEL 9.4+, Ubuntu 24.04, Debian 13) have updated terminfo databases that handle xterm-ghostty correctly, 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.

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:

  1. Modify Ghostty’s source code to support TERM override (not practical)
  2. Use SSH config (recommended)
  3. Apply server-side fixes

Summary

ApproachProsCons
SSH ConfigOne-time setup, applies globally, no server changesNone
Server-side ~/.bashrcWorks if SSH config unavailableRequires changes on each server
Ghostty configWould be terminal-centricNot 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 linux terminal type is widely supported and stable across all Linux distributions