Repository navigation
fix(ssh): omit the PTY marker without a remote terminal - #858
Open
Aschenbath wants to merge 1 commit into
Open
Aschenbath wants to merge 1 commit into
Aschenbath wants to merge 1 commit into
Conversation
A JumpServer (KoKo) direct login runs the startup wrapper without a remote terminal. tty then prints "not a tty", the identity filter keeps that malformed marker verbatim by design, and the pane shows PEBREL_PTY_<token>=not a tty:<pid>. Emit the marker only when tty succeeds. The filter contract is unchanged, and such a pane gets no PTY identity, as before. Closes Kuddev#856 Co-Authored-By: Claude Opus 5.5 <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.
Result / 用户结果
Closes #856
An SSH pane's startup wrapper no longer prints
PEBREL_PTY_<token>=not a tty:<pid>whenttycannot name a terminal, which is what the report shows for a JumpServer (KoKo) direct connection. With a terminal, the marker is sent and hidden as before.Design / 设计边界
ssh_session::resume::startupbuilds the POSIX startup wrapper. It now runsif pebrel_tty=$(tty 2>/dev/null); then printf '<marker>' "$pebrel_tty" "$$"; fi. When stdin is not a terminal,ttyexits non-zero and printsnot a tty, and that text used to become the marker value.IdentityInputstill keeps foreign, malformed, partial and oversized markers byte-exact, as recorded in2026-10-25-pane-session-recovery.md. Hiding malformed markers in the filter would drop bytes that contract preserves, so the wrapper simply stops producing one. A pane without a terminal still gets no PTY identity, because the old marker already failedPtyIdentity::parse. Its recovery behaviour is therefore unchanged.pebrel_ttyis not exported, so the exec'd shell's environment is unchanged. The script uses only the quoting and expansion forms that the startup probe already checks.TmuxSessionControl.kt,PtyIdentityInput.kt) has the same unguarded$(tty)and also keeps malformed markers visible. I can't build or test Android in this environment, so that is left for a follow-up.Evidence / 验证依据
ssh_session::resume::tests::startup_reports_a_named_terminal_and_sends_no_marker_without_oneruns the real startup script throughshtwice. With anopenptyterminal as stdin, the marker is parsed and hidden, and the identity equalsttyname. With null stdin, only the shell's own output is visible and no identity is recorded.main'sresume.rs): it fails with"\u{1e}PEBREL_PTY_0123…=not a tty:11056\u{1f}DEFAULT\n"instead of"DEFAULT\n", which is the reported symptom. The other six resume tests pass.cargo test --config .github/ci-profile.toml --profile ci --locked --workspace --features nebula/gpui-test-support --bin pebrel -- ssh_session::resume: 7 passed, 1 ignored on the final commite0a152cb. The ignored test is the opt-in OpenSSH acceptance, which needsPEBREL_SSH_RESUME_FIXTUREand was not run.script), dash (/bin/shhere) and bash emit/dev/pts/N:<pid>. With stdin/dev/nullor closed, or with nottyonPATH, the guard prints nothing to stdout or stderr.cargo clippy -j 1 --locked -p nebula --no-deps --all-targets --features gpui-test-support: no diagnostics inresume.rsorresume/tests.rs. It ran on3fe4efc8; the final commit differs only by adding2>/dev/nullinside the startup string literal. The command still fails on the existing deny-level backlog: 1,797 errors in other files of thepebreltest target. No lint configuration changed.cargo fmt --all -- --check,git diff --check,python3 scripts/check_architecture.py --base 42ffd11ff95db61eacaf026319c0bfb3bed3bea1and the three architecture unittest modules (55 passed): all passed.--bin pebrelsuite. Both attempts were SIGKILLed while compiling the test binary, before any test ran: this shared 7.7 GiB VM ran out of memory during a concurrent build. Also not run: the i18n contract andnebula-settingstests (nothing changed there), and a real JumpServer/KoKo server or Windows client.Required Review / 必须确认
CONTRIBUTING.md,docs/architecture.md, anddocs/project-constraints.md.python3 scripts/check_architecture.py --base 42ffd11ff95db61eacaf026319c0bfb3bed3bea1passes; no budget changed.🤖 Generated with Claude Code