Niko Kultalahti

Current Cloud Specialist, ex-RevOps, Future Cloud Engineer. A father (of two) and a husband (of one).

I was having an issue with Ghostty when SSH’ing into a server When I hit backspace it inputted a normal space instead.

Apparently, this might be expected and has something to do with terminal emulation and preserving some environmental variables such as TERM. Here’s more info about it: https://ghostty.org/docs/help/terminfo

I bumbed into this issue when I used gcloud compute ssh to SSH into a VM in Google Cloud. I fixed this by setting the following in .zshrc:

gcloud() {
    # Detects if 'compute ssh' is invoked anywhere in the command arguments
    if [[ "$*" == *"compute ssh"* ]]; then
        TERM=xterm-256color command gcloud "$@"
    else
        command gcloud "$@"
    fi
}