Skip to content

Investigate visible shell-integration echo in raw terminal #66

Open

Description

@R055LE

Device finding

On the signed alpha.13 owner device, after running ordinary transcript commands (pwd, cd /tmp, pwd) and opening the raw terminal, the visible scrollback contains large builtin eval / Threadline shell-integration invocations with literal escaped newlines. The actual prompts and command output still appear, but the integration text overwhelms the terminal view.

Investigation

SessionManager already has InternalInputEchoFilter, which hides only an exact PTY echo of Threadline-authored input. The owner-device result suggests that this exact match is not occurring for at least some generated invocations. Determine the actual echo shape and when it reaches the terminal. Do not infer raw bytes from the screenshot alone.

Acceptance

  • On a signed device, short transcript commands followed by a switch to raw terminal do not leave large Threadline-authored integration invocations in visible scrollback when their echo can be proven exact.
  • Ambiguous or mismatched remote bytes still pass through unchanged and in order, per the product invariant.
  • Add focused coverage for the observed PTY behavior and check structured commands plus direct raw-terminal input on the same session.

No hostnames, key material, or raw command payloads should be added to public diagnostics while investigating.

Activity

  1. R055LE commented on Sep 29, 2026

    @R055LE
    OwnerAuthor

    Reproduced on the disposable API 35 emulator with the real OpenSSH fixture while validating #48. fixtures/openssh/test-android-structured.sh stopped at the existing bootstrap raw-terminal assertion in AndroidStructuredShellIntegrationTest.productionSessionRetainsStateAndReportsCommandLifecycle (before the reply cases):

    Bootstrap input reached terminal history: inputBytes=1492, sharedBytes=1493

    The shared prefix covers the authored input plus the PTY line ending. This supports the owner-device screenshot finding, but does not yet establish why InternalInputEchoFilter failed to omit it. A separate targeted real-SSH reply test passed without changing the raw-byte assertion. No fixture credentials or captured terminal payloads are attached.

  2. R055LE commented on Oct 1, 2026

    @R055LE
    OwnerAuthor

    The real OpenSSH fixture reproduced this on the API 35 emulator. A temporary test-only probe counted two exact CRLF-normalized copies of the bootstrap line in SSH output and one remaining copy in terminal history after filtering:

    inputBytes=1492, sharedBytes=1493, sshExactEchoes=2, terminalExactEchoes=1

    The probe recorded counts without publishing terminal payloads and has been removed. A JVM regression using the same duplicate-echo shape failed on the old filter.

    PR #70 permits at most two exact bootstrap echoes until the existing lifecycle cancellation or bootstrap timeout. Ordinary command wrappers keep the single-echo limit. Focused tests preserve surrounding output, mismatched bytes, partial matches, and direct raw input.

    ./gradlew test lint assembleDebug passed, and the full fixtures/openssh/test-android-structured.sh gate now passes all three cases, including the formerly failing bootstrap assertion and a raw command followed by a structured command on the same session.

    Signed owner-device acceptance remains pending, so this issue stays open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions