Skip to content

Fix remote SSH terminal compatibility - #756

Merged
sbertix merged 2 commits into
supabitapp:mainfrom
bmargula:fix/remote-ssh-terminfo-fallback
Aug 2, 2026
Merged

Fix remote SSH terminal compatibility#756
sbertix merged 2 commits into
supabitapp:mainfrom
bmargula:fix/remote-ssh-terminfo-fallback

Conversation

@bmargula

@bmargula bmargula commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Closes #754

Summary

Add a remote-side compatibility prelude for Supacode-managed interactive SSH
surfaces. When the local terminal advertises xterm-ghostty, the prelude checks
whether the remote host has that terminfo entry and falls back to
xterm-256color only when it is unavailable.

Supacode launches SSH directly instead of passing through Ghostty's normal SSH
wrapper, so fresh remote accounts currently miss that compatibility behavior.
Terminal-aware commands such as clear, less, and tput can consequently
fail with unknown terminal type: xterm-ghostty.

The check runs under POSIX /bin/sh before the configured remote login shell
loads its profile. Hosts with xterm-ghostty support retain its richer
capabilities, other TERM values remain unchanged, and non-interactive
SSHCommand.invocation calls are unaffected. Both interactive command shapes
share one compatibility seam.

Type of change

  • Bug fix (the linked issue is a bug report)
  • Feature (the linked issue is a feature request marked ready)
  • Documentation
  • Other (please describe)

How was this tested?

  • make check passes (format + lint)
  • make test passes
  • I built and ran the app to confirm the change works

Completed locally:

  • The mise-pinned swift-format lint --strict passes for both changed files.
  • swiftc -frontend -parse accepts both changed files.
  • git diff --check passes.
  • Shell behavior tests cover supported xterm-ghostty, missing/unknown
    xterm-ghostty (including an unavailable infocmp), and an unrelated TERM.
  • A real SSH PTY preserves xterm-ghostty when the remote entry exists and
    resolves to xterm-256color when a missing entry is simulated; tput clear
    exits successfully in both cases.

The repository commands were attempted but cannot complete on this machine:

  • make check completes formatting, then SwiftLint cannot load SourceKit
    because no full Xcode toolchain is installed.
  • make test stops in the repository preflight because Xcode 26.3 is absent.
  • make doctor otherwise passes and reports Xcode 26.3 as its only remaining
    prerequisite.

The three test/build checkboxes above should remain unchecked until those
commands pass with Xcode 26.3 and the app has been exercised from a built copy.

AI tool disclosure (optional)

  • Model(s): GPT-5
  • Harness / tools: Codex

Checklist

  • This pull request is linked to an issue with Closes # above.
  • For a feature, the linked issue is labeled ready.
  • I am the author of this work and accountable for it; no commit is authored or co-authored by an AI agent.
  • I have read the Contributing guide and the Code of Conduct.

@bmargula
bmargula marked this pull request as ready for review August 1, 2026 20:13
… tests

Scope the terminfo probe's PATH augmentation to a subshell so a profile-only
infocmp still resolves xterm-ghostty without leaking PATH into the session.
Trim the new docstrings to the load-bearing rationale. Add an independent
assertion that the wrapper embeds the fallback prelude, cover TERM unset/empty
and a single-quote payload round-trip, and switch output decoding to the
repo's failable String(bytes:encoding:) form.

@sbertix sbertix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙇‍♂️

@sbertix
sbertix enabled auto-merge (squash) August 2, 2026 21:47
@sbertix
sbertix merged commit 637ef1b into supabitapp:main Aug 2, 2026
3 of 4 checks passed
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.

Remote SSH surfaces do not install bundled xterm-ghostty terminfo

2 participants