Skip to content

fix(app): preserve terminal history when reconnecting SSH - #245

Open
loooinfo wants to merge 3 commits into
TooonyChen:mainfrom
loooinfo:bugfix/preserve-ssh-reconnect-history
Open

loooinfo wants to merge 3 commits into
TooonyChen:mainfrom
loooinfo:bugfix/preserve-ssh-reconnect-history

Conversation

@loooinfo

@loooinfo loooinfo commented Nov 24, 2026 •

Copy link
Copy Markdown

Summary

After SSH disconnects, Reconnect retains earlier output and scrollback in the existing tab and each split pane. The new shell appends below retained content, failed attempts keep the display for retry, and choosing Disconnect in the session menu preserves output as well.

The ended transport closes separately from its emulator. MyGo History/Feed transfers styled output at the original width before a gated reader accepts new output. Alternate-screen modes 47/1047/1049 recover the full ended main screen, avoiding cursor-dependent truncation. Canceled SFTP initialization errors and directory/tree results from replaced clients cannot overwrite the new file panel; ending a connection clears canceled loading flags. Closing a pane/tab/application releases the retained terminal. English and Simplified Chinese docs and headless screenshots are included.

Screenshots: English · Simplified Chinese.

Closes #244

Testing

  • The original history regression fails on unmodified upstream 78c2f91; audit reproductions also fail before their fixes for modes 47/1047 and delayed SFTP/directory/tree callbacks.
  • Five added audit tests with three alternate-mode subtests pass against real MyGo terminals and the in-process real SSH/SFTP server. Broader history, reconnect, pane and file/dir race regressions pass (108.314s), including cancellation/disposal, failed retry, split isolation, Unicode/styles/wrapping, output ordering and no history sent to SSH stdin.
  • The six-feature integration passes 47 relevant top-level race tests with one skip. Its 169 production Go files match the combined custom sources. Go vet and MyGo vet pass on the independent PR, combined edition and integration worktree; the PR merges cleanly with upstream main.
  • Final combined go test -race ./... -count=1 -timeout 20m completes: app has 374 passed, 16 skipped and only the three failures already reproduced on unmodified upstream (TestBackgroundImage, TestBackgroundReadsOffUIThread, TestCommandBarPage). Other packages pass or have no tests. No races, timeouts or unfinished tests. The earlier independent full run has the same three baseline failures.
  • Windows amd64 custom 0.4.1 cross-build and package/source-patch checks pass. This PR keeps upstream release configuration and does not include other feature branches. Native Windows/macOS GUI and an external SSH server were not exercised; no Wine prefix was created.

Generated by OpenAI Codex.

This branch has not been deployed

No deployments
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.

fix(app): preserve terminal history when reconnecting SSH

1 participant