Skip to content

Commit 35009ec

Browse files
committed
fix(ssh): fallback terminal for tmux on ghostty
1 parent 010fe05 commit 35009ec

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

docs/troubleshooting.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
- For unstable links, increase:
4242
- `spec.ssh.keepAliveIntervalSeconds`
4343
- `spec.ssh.keepAliveTimeoutSeconds`
44+
- If tmux login fails with `missing or unsuitable terminal` (for example `xterm-ghostty`), upgrade to a sidecar image that includes terminal fallback handling, then recreate the pod with `okdev down && okdev up`.
4445

4546
## Local State Files
4647

infra/sidecar/entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ fi
8080
# Interactive login shell in dev container.
8181
# Wrap in tmux if enabled (OKDEV_TMUX=1) and not opted out (OKDEV_NO_TMUX!=1).
8282
if [ "${OKDEV_TMUX_FLAG:-}" = "1" ] && [ "${OKDEV_NO_TMUX:-}" != "1" ] && command -v tmux >/dev/null 2>&1; then
83+
# Some modern terminals (for example Ghostty) may not exist in the sidecar
84+
# terminfo database. Use a widely available fallback for tmux startup.
85+
if [ "${TERM:-}" = "xterm-ghostty" ]; then
86+
export TERM="xterm-256color"
87+
fi
8388
if nsenter --target "$DEV_PID" --mount -- test -x /bin/bash 2>/dev/null; then
8489
exec tmux new-session -A -s okdev "nsenter --target $DEV_PID --mount --uts --ipc --pid -- /bin/bash -l"
8590
else

0 commit comments

Comments
 (0)