fix(remote): harden iTerm2 window select + remote uid probe (follow-up to #201)#202
Merged
Conversation
Follow-up hardening on #201: - Guard each iTerm2 `select <window>` with its own `try` so an unexpected failure (e.g. a window mid fullscreen-transition) can't abort the surrounding script and skip the tab/session select — that would have made the jump worse than before. - Probe the remote uid with a bare `id -u` instead of a `$(...)` pipeline so it runs identically under non-POSIX login shells (fish/csh) instead of silently falling back to the shared socket path. Also drops the redundant cleanup round-trip (StreamLocalBindUnlink already clears stale sockets on bind), so a failing host no longer waits on a second SSH. - Remove the now-unused shellSingleQuoted helper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GeorgeDong32
pushed a commit
to GeorgeDong32/CodeIsland
that referenced
this pull request
May 31, 2026
…#202) Follow-up hardening on wxtsky#201: - Guard each iTerm2 `select <window>` with its own `try` so an unexpected failure (e.g. a window mid fullscreen-transition) can't abort the surrounding script and skip the tab/session select — that would have made the jump worse than before. - Probe the remote uid with a bare `id -u` instead of a `$(...)` pipeline so it runs identically under non-POSIX login shells (fish/csh) instead of silently falling back to the shared socket path. Also drops the redundant cleanup round-trip (StreamLocalBindUnlink already clears stale sockets on bind), so a failing host no longer waits on a second SSH. - Remove the now-unused shellSingleQuoted helper. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self-review follow-up on #201.
1. iTerm2
select <window>could abort the jump#201 added
select <window>to raise the matched window on fullscreen / cross-Space jumps. iTerm2 does supportselecton a window, but if it ever throws (window mid-transition, etc.) the surroundingtrywould swallow it and skip theselect tab/select sessionthat follow — i.e. the jump would do nothing, worse than before #201. Eachselect <window>is now wrapped in its owntryon all three match paths (session-id / tty / cwd).2. Remote uid probe used a non-POSIX pipeline
The probe ran
uid=$(id -u ...); rm -f ...; printf .... SSH runs remote commands under the user's login shell, so on afish/cshlogin shell the$(...)form fails and we silently fall back to the shared socket path (defeating #193 for those users). Replaced with a bareid -u, which behaves identically under any shell. Also removed the redundant stale-socket cleanup (the forward'sStreamLocalBindUnlink=yesalready handles it), so a host that's failing to connect no longer eats a second SSH round-trip.3. Removed the now-unused
shellSingleQuotedhelper.swift test— 341 passing.🤖 Generated with Claude Code