Skip to content

fix: set TERM in local terminal so backspace/delete work#480

Merged
nadaverell merged 1 commit intomainfrom
fix/local-terminal-term-env
Apr 16, 2026
Merged

fix: set TERM in local terminal so backspace/delete work#480
nadaverell merged 1 commit intomainfrom
fix/local-terminal-term-env

Conversation

@nadaverell
Copy link
Copy Markdown
Contributor

Summary

Backspace was printing a space and Delete was printing ~ in the local (OS) terminal tab. Fix by setting TERM=xterm-256color on the shell process.

Why

xterm.js sends 0x7f for Backspace and CSI 3~ for Delete. Without TERM set, the shell's terminfo doesn't bind these escape sequences, so they fall through as raw bytes.

When Radar is launched from a GUI (desktop app, or browser opening the binary), the inherited environment typically has no TERM. Pod exec already handles this (internal/server/exec.go:53); local terminal was missing the same.

Fixes #372

xterm.js sends 0x7f for Backspace and CSI 3~ for Delete. Without TERM
set, the shell's terminfo doesn't bind these sequences — Backspace
shows as a space and Delete leaks through as ~.

Radar launched from a GUI (desktop app, browser) inherits an env that
often has no TERM. Pod exec already sets TERM=xterm-256color; local
terminal was missing the same.

Fixes #372
@nadaverell nadaverell requested a review from hisco as a code owner April 16, 2026 11:00
@nadaverell nadaverell merged commit e974919 into main Apr 16, 2026
5 of 6 checks passed
@nadaverell nadaverell deleted the fix/local-terminal-term-env branch April 16, 2026 11:04
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.

Backspaces in terminal don't remove characters, they add a space

1 participant