feat(terminal): press R to reconnect disconnected sessions#52
Open
htazq wants to merge 1 commit into
Open
Conversation
tookdes
pushed a commit
to tookdes/r-shell
that referenced
this pull request
Jul 19, 2026
tookdes
pushed a commit
to tookdes/r-shell
that referenced
this pull request
Jul 19, 2026
Resolve test conflicts with GOODBOY008#52 by keeping both reconnect and unread-output suites.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a keyboard-first reconnect workflow for terminal tabs by allowing R/r to trigger reconnect only when the active terminal is in a disconnected state, while also aligning PTY disconnect messaging with the existing Auto Reconnect setting and new localized guidance strings.
Changes:
- Add a scoped
onKeyDownhandler soR/rreconnects only the active disconnected terminal tab (ignoring repeats, modifiers, and IME/composition events). - Respect the persisted Auto Reconnect setting when the PTY WebSocket closes; when disabled, stop retrying and prompt for manual reconnect.
- Introduce localized terminal guidance strings for manual reconnect and exhausted auto-reconnect attempts (EN + zh-CN), and add test coverage for the new behaviors.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/terminal/terminal-tab-portals.tsx | Adds the R/r reconnect key handler gated to active + disconnected terminal tabs. |
| src/components/pty-terminal.tsx | Honors Auto Reconnect on WS close and prints localized manual reconnect guidance when applicable. |
| src/locales/en.json | Adds new ptyTerminal.* strings for reconnect guidance. |
| src/locales/zh-CN.json | Adds Chinese translations for the new reconnect guidance strings. |
| src/tests/terminal-tab-portals.test.tsx | Tests that only the active disconnected tab reconnects on an unmodified R key. |
| src/tests/pty-terminal-activation.test.tsx | Tests that auto-reconnect stops when disabled and manual guidance is printed. |
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.
Summary
R/rto reconnect only the active disconnected terminalVerification
pnpm test src/__tests__/pty-terminal-activation.test.tsx src/__tests__/terminal-tab-portals.test.tsx src/__tests__/keyboard-shortcuts-hook.test.tsx src/__tests__/keyboard-shortcuts.test.ts(40 passed)pnpm exec tsc --noEmitpnpm exec eslint src/components/pty-terminal.tsx src/components/terminal/terminal-tab-portals.tsx --quietpnpm i18n:checkpnpm buildFull
pnpm test: 476 passed; the 7 existingsrc/__tests__/connection.test.tscases still require a Tauri runtime and fail in plain Vitest becausewindow.__TAURI_INTERNALS__.invokeis unavailable.Closes #12