mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-20 23:20:46 +00:00
1d91c8fbf4e22d48fe2ff0130784fadfe2062853
160
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
99e1a8d6d8 |
fix(zmodem): keep transfer listeners across same-session reconnects (#1962)
* fix(zmodem): keep transfer listeners across same-session reconnects The preload netcatty:exit handler dropped the per-session zmodem listener sets, but auth-failure retries and auto-reconnects reuse the same sessionId without remounting the terminal, so useZmodemTransfer never re-subscribed and rz/sz progress + overwrite dialogs silently stopped appearing (#1955). Move listener cleanup to explicit closeSession and prune empty sets on subscriber dispose instead. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(zmodem): gate event delivery instead of dropping listeners on close Codex review caught that reconnects also call closeSession with the terminal still mounted (startReconnect -> cleanupSession), so clearing listener maps there reintroduced the bug for manual/auto reconnects. Keep listener sets owned by renderer subscribers and gate zmodem event delivery on closedTerminalDataSessions, which is cleared when a session restarts with the same id. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
da81caa72c | Harden terminal flood flow control | ||
|
|
0cbb377385 | keep terminal exit cleanup after close | ||
|
|
ee3dce4cc5 | ignore duplicate terminal exit events | ||
|
|
32d9824eb9 | preserve reconnect exit listener | ||
|
|
cdcacaef28 | fix terminal reconnect output retention | ||
|
|
cb2189a2e3 | Improve SSH Ctrl-C responsiveness | ||
|
|
5080d62a8b | Fix worker terminal AI and output edge cases | ||
|
|
3b774ca9a1 | Improve terminal interrupt responsiveness | ||
|
|
f95cc754e7 |
fix(windows): restore main-window input focus on show/hide hotkey (#1722)
Route global hotkey/tray show paths through restoreWindowInputFocus, recover renderer focus on visibility/show, dismiss transient overlays before native hide, and cancel deferred focus callbacks on hide. Closes #1722 |
||
|
|
33dec754d5 | Fix terminal startup output race | ||
|
|
0d8d68d954 |
fix(telnet): handle NVT newlines and echo mode (#1649)
* fix(telnet): normalize NVT newlines * fix(telnet): handle echo negotiation * fix(telnet): align echo negotiation |
||
|
|
9013a7e312 | fix terminal popup release behavior (#1403) | ||
|
|
d2fa4f1cd9 | Fix cmd PTY wrapper expansion | ||
|
|
9e2b8093fb | fix terminal split connection reuse (#1249) | ||
|
|
8376e35022 |
fix: macOS 自动更新装不上(进程退不掉) (#1224)
* fix(auto-update): commit app to quit before quitAndInstall on macOS (#1215) macOS in-place auto-update downloaded and unpacked the new version but never installed it: the app appeared to close, ShipIt never ran, and no restart happened. A full uninstall + reinstall did not help; only a manual DMG replace worked. Root cause is a code-level coordination bug, not the release pipeline. The published mac zips are correctly Developer-ID signed, notarized, and stapled (Team H7WS5L2ML4, consistent across 1.1.17 and 1.1.20), and latest-mac.yml is well-formed — so Squirrel.Mac signature validation passes. The failure is that quitAndInstall() drives app.quit() while two normal-quit behaviors keep the process alive: 1. the main-window close handler hides to tray when close-to-tray is enabled (it only closes when isQuitting is true), and 2. the before-quit dirty-editor guard preventDefault()s the quit for a 5s renderer round-trip. Either keeps the parent process running, so Squirrel.Mac's ShipIt helper — which waits on the parent PID to die before swapping the bundle — lands in launchd "pending spawn / on-demand-only" limbo and the service is removed without installing. This matches the reporter's diagnosis exactly ("ShipIt 没有真正启动安装器", launchd on-demand-only). Fix: before quitAndInstall fires app.quit(), mark the app as quitting for an update via windowManager.setQuittingForUpdate(true). That sets isQuitting (bypassing close-to-tray) and the before-quit handler now returns early when isQuittingForUpdate() is true (skipping the dirty-editor round-trip), so the process exits cleanly and ShipIt can run. The same fix also covers the latent Windows NSIS case where close-to-tray would block an in-place update. If the install never actually quits the app (quitAndInstall throws, or returns without app.quit() on a Squirrel follow-up error / stale download), the quitting-for-update flags are rolled back — synchronously on throw, and via a short unref'd watchdog otherwise — so the app does not get stuck permanently bypassing close-to-tray and the quit guard. Tests: unit tests for the new windowManager flags and for the install handler — ordering (setQuittingForUpdate before quitAndInstall), tray cleanup still runs, no-op when the updater fails to load, rollback on synchronous throw, and watchdog rollback when the app never quits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(auto-update): keep dirty-editor guard during update install setQuittingForUpdate only bypasses close-to-tray (so the window actually closes and Squirrel.Mac's ShipIt can swap the bundle); it must NOT skip the unsaved-work guard, or clicking "Restart Now" with a dirty SFTP editor would silently lose edits. If the user cancels to save, the quit aborts and autoUpdateBridge's watchdog clears the quitting-for-update flags. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(auto-update): clear update-quit state when the quit is cancelled When the user clicks "Restart Now" with a dirty editor open, the before-quit guard cancels the quit (settle "stay"). The update path had already called setQuittingForUpdate(true) (which flips isQuitting=true to bypass close-to-tray for the install), so without clearing it the app stays in a quitting state — close-to-tray and other !isQuitting-gated behavior bypassed — until the 10s watchdog fires. Clear it immediately on the cancelled-quit path (#1215 review). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(auto-update): check for unsaved editors before quitAndInstall (#1215) The previous fix bypassed close-to-tray so the app process actually exits and Squirrel.Mac's ShipIt can swap the bundle, while keeping the before-quit dirty-editor guard as the unsaved-work safety net. But on macOS that net has a hole: quitAndInstall() closes the window FIRST and only then fires before-quit. Once setQuittingForUpdate(true) lets the main window truly close (instead of hiding to tray), the before-quit guard can run after the window is already gone — isReachableByUser is false, so it commits the quit and silently drops unsaved SFTP edits. Fix: move the dirty-editor check to the moment the user clicks "Restart Now", in the install handler, BEFORE setQuittingForUpdate / quitAndInstall — while the window and renderer are still alive: - dirty -> abort the install (don't set the quitting flags, don't quitAndInstall) and broadcast netcatty:update:needs-save so the renderer prompts the user to save and retry. - clean -> proceed with the existing flow (commit-to-quit, tray cleanup, quitAndInstall, watchdog). - no reachable main window / crashed renderer -> install directly (no user to ask), matching the before-quit fail-open path. The before-quit dirty guard is kept as defense-in-depth: if the window is still reachable it re-checks (clean, since we just verified), and if it's already gone it lets the quit through — which is now safe because the install handler already confirmed there were no unsaved editors. The request/reply/timeout round-trip is extracted into a shared helper, electron/bridges/dirtyEditorGuard.cjs (queryDirtyEditors), so the install handler and main.cjs's before-quit guard use one implementation. main.cjs's before-quit is refactored onto it (behavior preserved: sender-filtered reply, fail-open timeout, and the setQuittingForUpdate(false) rollback when the user cancels to save). The needs-save notice is BROADCAST to every window, not just the queried main window: "Restart to Update" can be clicked from the Settings window, which would otherwise see the click do nothing. preload exposes onUpdateNeedsSave; the subscription lives in useUpdateCheck (state layer), and both consumers — App.tsx (main window) and SettingsPage (settings window) — pass an onNeedsSave callback that shows an actionable toast ("save your editors, then click Restart Now again") in en / zh-CN / ru. Also lengthen the quitting-for-update rollback watchdog from 10s to 60s. On macOS quitAndInstall() can return while Squirrel is still pulling the downloaded ZIP from the local update server before it closes the windows; on a large/slow update that can exceed 10s. Clearing isQuitting that early would let the eventual native quit hit a non-quitting close-to-tray handler and strand the install again — the exact #1215 failure. The longer window only fires when the app is realistically stuck, at the cost of close-to-tray staying bypassed a little longer in the rare genuine-failure case. Tests: queryDirtyEditors (result / no-dirty / timeout / wrong-sender / dead or crashed webContents / send-throws / no-ipcMain paths); install handler pre-check (dirty -> no quitAndInstall + needs-save broadcast to all windows; clean -> quitAndInstall runs; no main window -> installs without asking). Existing install-handler tests updated for the now-async handler. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
1fec5925eb | Refactor large modules and fix runtime errors (#1136) | ||
|
|
453202df8f | perf(terminal): add output flow control / back-pressure for heavy streams (#1090) | ||
|
|
78186d8d46 |
feat #1064: prompt to overwrite when rz upload hits a remote filename conflict (#1070)
* feat #1064: add buildUploadPlan for rz overwrite/skip/cancel resolution Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat #1064: handle remote filename conflicts in rz handleUpload Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat #1064: SSH exec probe + remove for rz upload conflicts Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat #1064: IPC for rz overwrite-conflict prompt Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat #1064: renderer prompt for rz overwrite conflicts Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix #1064: repair sshBridge test mock (ipcMain.on) and i18n the overwrite dialog Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix #1064: make upload plan index-based to preserve per-file decisions Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
7bd5d6465a | fix claude system cli detection (#1033) | ||
|
|
5b2a048917 | Add transfer target path actions (#997) | ||
|
|
b0949f1a1e |
feat(sftp): add drive switcher dropdown for local Windows panes (#953)
* feat(sftp): add drive switcher dropdown for local Windows panes On Windows, the SFTP breadcrumb's first segment (drive letter) now shows a dropdown to switch between available drives. This makes it easy to navigate across drives without manually editing the path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(sftp): probe drives async to avoid blocking main process fs.accessSync in the listDrives IPC handler could stall the Electron main process for seconds per disconnected mapped drive or empty optical drive. Use fs.promises.access with Promise.allSettled so the 26 probes run in parallel without blocking the event loop. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com> |
||
|
|
bce33f34ee | Fix SSH known host verification | ||
|
|
b65ed74ced |
Merge pull request #922 from binaricat/feat/915-sftp-upload-context-menu
Add Upload File(s) item to SFTP context menu |
||
|
|
6c6a051c0c | Fix SFTP upload context menu handling | ||
|
|
2329014e22 | fix: harden SSH key passphrase flows | ||
|
|
f1cfce45cf | feat: Enhance SSH key management with reference key support and UI updates | ||
|
|
eb1fd9c127 | Harden Telnet auto-login | ||
|
|
1b08e5ee88 |
[codex] Fix SFTP editor saved state (#887)
* Fix SFTP editor saved state * Restore window input focus after SFTP editor * Harden SFTP editor save flows |
||
|
|
d86c5ed05a |
[codex] Remove mosh client path setting (#878)
* fix(terminal): remove mosh client path setting * fix(terminal): remove stale mosh detection bridge |
||
|
|
74d56cdcb8 |
[codex] Settings: detect & override mosh client path (#849)
* Add Mosh client detection and override in Settings → Terminal Builds on PR #847 (auto-detection across PATH gaps). Power users with non-standard install locations (containers, custom builds, multiple mosh versions) can now point the app at a specific mosh binary; less technical users get a one-click "Detect" button to confirm where mosh was found, with a Browse fallback for clicker-only flows. Backend (electron/bridges/terminalBridge.cjs): - detectMoshClient() returns { platform, found, path, searchedPaths }. Reuses resolvePosixExecutable; surfaces the searched dirs so the UI can tell users where to look when nothing was found. - pickMoshClient() opens a native file picker via dialog.showOpenDialog. - startMoshSession honors options.moshClientPath when provided. Strict failure: a missing/non-executable explicit path produces a clear error instead of falling back to auto-detect, so users notice typos and stale paths instead of getting silent recovery. UI (components/settings/tabs/SettingsTerminalTab.tsx): - New SettingRow under "Connection" with text input + Detect + Browse buttons, mirroring the localShell validation pattern. Shows inline validation (notFound/isDirectory) and the last detect result with searched directories on miss. Plumbing: - TerminalSettings.moshClientPath: string field with default "" so empty == auto-detect (matches existing PR #847 semantics). - preload exposes detectMoshClient + pickMoshClient. - createTerminalSessionStarters passes terminalSettings.moshClientPath into the IPC call, undefined when blank. - en.ts / zh-CN.ts get the 9 new strings. Verified locally: - vite build succeeds; settings tab renders. - detectMoshClient() against the live machine returns /opt/homebrew/bin/mosh with the expected searchedPaths list. - Existing PR #847 auto-detection path is unchanged when the field is empty. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Skip POSIX execute-bit check for explicit Windows mosh path Address Codex P2 on PR #849 commit |
||
|
|
a1866747a5 | fix(cloud-sync): harden auth cancellation flow | ||
|
|
78fc4628b9 | refactor(cloud-sync): simplify OAuth callback flow | ||
|
|
c721591466 |
fix(cloud-sync): fall back to OS-assigned OAuth port when 45678 is busy (#823)
The Google Drive / OneDrive PKCE flow bound a temporary callback server on
a hardcoded 127.0.0.1:45678. If anything on the user's machine already
holds that port (another desktop app, a leftover process, a firewall rule)
the listen fails with EADDRINUSE and the user sees
"Error invoking remote method 'oauth:startCallback': EADDRINUSE".
Split the bridge into a two-step flow so the chosen port is known before
we build the authorization URL:
- oauthBridge.prepareOAuthCallback(): tries the preferred 45678 first,
falls back to an OS-assigned free port (listen(0)) if it's in use, and
returns { port, redirectUri }.
- oauthBridge.awaitOAuthCallback(state): awaits the code on the
already-prepared server.
CloudSyncManager.startProviderAuth now requires the redirectUri to be
passed in; useCloudSync calls prepare → startProviderAuth(redirectUri) →
await, and cancels the prepared server if anything fails before the
browser hop.
windowManager's in-app-popup allow-list reads the active port from
oauthBridge at popup-open time instead of hardcoding 45678, so the
loopback callback keeps working regardless of which port was chosen.
Also: unref() the callback server and closeAllConnections() on teardown
so the OS port is released promptly between flows and test runs don't
leave zombie listeners.
Tests: new electron/bridges/oauthBridge.test.cjs covers the preferred-
port path, the busy-port fallback (#823 regression), the state-mismatch
rejection, the provider-error rejection, the "await without prepare"
guard, and cancel/release semantics. All 85 bridge tests still pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|
|
4090483738 |
Fix Security Issues (#799)
* chore(deps): bump fast-xml-parser and @aws-sdk/xml-builder Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) and [@aws-sdk/xml-builder](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages-internal/xml-builder). These dependencies needed to be updated together. Updates `fast-xml-parser` from 5.3.4 to 5.5.8 - [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases) - [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v5.3.4...v5.5.8) Updates `@aws-sdk/xml-builder` from 3.972.4 to 3.972.18 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages-internal/xml-builder/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/HEAD/packages-internal/xml-builder) --- updated-dependencies: - dependency-name: fast-xml-parser dependency-version: 5.5.8 dependency-type: indirect - dependency-name: "@aws-sdk/xml-builder" dependency-version: 3.972.18 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump follow-redirects from 1.15.11 to 1.16.0 Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.11 to 1.16.0. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.11...v1.16.0) --- updated-dependencies: - dependency-name: follow-redirects dependency-version: 1.16.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump hono from 4.12.7 to 4.12.14 Bumps [hono](https://github.com/honojs/hono) from 4.12.7 to 4.12.14. - [Release notes](https://github.com/honojs/hono/releases) - [Commits](https://github.com/honojs/hono/compare/v4.12.7...v4.12.14) --- updated-dependencies: - dependency-name: hono dependency-version: 4.12.14 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump vite from 7.3.1 to 7.3.2 Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.3.1 to 7.3.2. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v7.3.2/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v7.3.2/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 7.3.2 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump flatted from 3.3.3 to 3.4.2 Bumps [flatted](https://github.com/WebReflection/flatted) from 3.3.3 to 3.4.2. - [Commits](https://github.com/WebReflection/flatted/compare/v3.3.3...v3.4.2) --- updated-dependencies: - dependency-name: flatted dependency-version: 3.4.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump minimatch from 3.1.2 to 3.1.5 Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump lodash from 4.17.23 to 4.18.1 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.23 to 4.18.1. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.23...4.18.1) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.18.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump @hono/node-server from 1.19.11 to 1.19.14 Bumps [@hono/node-server](https://github.com/honojs/node-server) from 1.19.11 to 1.19.14. - [Release notes](https://github.com/honojs/node-server/releases) - [Commits](https://github.com/honojs/node-server/compare/v1.19.11...v1.19.14) --- updated-dependencies: - dependency-name: "@hono/node-server" dependency-version: 1.19.14 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump rollup from 4.57.1 to 4.60.2 Bumps [rollup](https://github.com/rollup/rollup) from 4.57.1 to 4.60.2. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v4.57.1...v4.60.2) --- updated-dependencies: - dependency-name: rollup dependency-version: 4.60.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump electron from 40.1.0 to 40.8.5 Bumps [electron](https://github.com/electron/electron) from 40.1.0 to 40.8.5. - [Release notes](https://github.com/electron/electron/releases) - [Commits](https://github.com/electron/electron/compare/v40.1.0...v40.8.5) --- updated-dependencies: - dependency-name: electron dependency-version: 40.8.5 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump path-to-regexp from 8.3.0 to 8.4.2 Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) from 8.3.0 to 8.4.2. - [Release notes](https://github.com/pillarjs/path-to-regexp/releases) - [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md) - [Commits](https://github.com/pillarjs/path-to-regexp/compare/v8.3.0...v8.4.2) --- updated-dependencies: - dependency-name: path-to-regexp dependency-version: 8.4.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump picomatch from 2.3.1 to 2.3.2 Bumps [picomatch](https://github.com/micromatch/picomatch) from 2.3.1 to 2.3.2. - [Release notes](https://github.com/micromatch/picomatch/releases) - [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/picomatch/compare/2.3.1...2.3.2) --- updated-dependencies: - dependency-name: picomatch dependency-version: 2.3.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump yaml from 2.8.2 to 2.8.3 Bumps [yaml](https://github.com/eemeli/yaml) from 2.8.2 to 2.8.3. - [Release notes](https://github.com/eemeli/yaml/releases) - [Commits](https://github.com/eemeli/yaml/compare/v2.8.2...v2.8.3) --- updated-dependencies: - dependency-name: yaml dependency-version: 2.8.3 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump @xmldom/xmldom from 0.8.11 to 0.8.13 Bumps [@xmldom/xmldom](https://github.com/xmldom/xmldom) from 0.8.11 to 0.8.13. - [Release notes](https://github.com/xmldom/xmldom/releases) - [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md) - [Commits](https://github.com/xmldom/xmldom/compare/0.8.11...0.8.13) --- updated-dependencies: - dependency-name: "@xmldom/xmldom" dependency-version: 0.8.13 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump brace-expansion from 1.1.12 to 1.1.14 Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.12 to 1.1.14. - [Release notes](https://github.com/juliangruber/brace-expansion/releases) - [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.12...v1.1.14) --- updated-dependencies: - dependency-name: brace-expansion dependency-version: 1.1.14 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump tar from 7.5.7 to 7.5.13 Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.7 to 7.5.13. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/node-tar/compare/v7.5.7...v7.5.13) --- updated-dependencies: - dependency-name: tar dependency-version: 7.5.13 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Security Fixes Security fixes: Added input validation for uncontrolled command lines. Added Proper Shell Escaping for useTerminalAutocomplete Fixed 4 race condition alerts by atomic stat+read(s) without following symlinks. Misc: Use Crypto randomness instead of Math.random() (Not a security issue but convenient) * Fix OS quirk fallbacks * Review fix - use lstat before open to skip FIFO/devices early to prevent blocks - SFTP skip UUID tag could be dubiously long * allow symlinks alongside regular files. * Use acutal target size for reading * Fix Destructed import / fix to use full shellEscape charset - Destructed import - Guard now matches full shellEscape charset * Supress Codex complaints Replaced manual fd.read with fs.promises.readFile(fd) to ensure complete file reads to EOF. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
a5b5f15343 |
feat(terminal): quick encoding switch for telnet & serial (closes #804) (#812)
* feat(terminal): extend quick encoding switcher to telnet and serial sessions Closes #804. TerminalToolbar only showed the UTF-8 / GB18030 encoding menu for SSH sessions. Telnet and serial sessions had no runtime control — their decoder was fixed at session start via charsetToNodeEncoding + Node's StringDecoder, which only knows utf8/latin1/ascii/utf16le. Users connecting to legacy telnet daemons or MCU consoles emitting GBK were stuck with the encoding chosen at connect time and could not switch to read non-latin text correctly. Main side (terminalBridge.cjs): - Swap StringDecoder for iconv-lite on the telnet + serial paths so GB18030 actually decodes. Local PTY and mosh keep StringDecoder — local follows the OS locale and mosh frames its own UTF-8, neither needs a runtime swap. - Store the decoder through a mutable decoderRef on the session object so the onData closures stay untouched while a new IPC handler can swap in a fresh decoder mid-session. - Add normalizeTerminalEncoding that resolves user-facing charset names (utf-8/gbk/gb2312/gb18030) into iconv identifiers. - Register netcatty:terminal:setEncoding, which updates the session's encoding + decoderRef (and mirrors to serialEncoding for aiBridge / mcpServerBridge exec calls that still read the legacy field). Renderer + preload: - preload.setSessionEncoding now tries the SSH handler first and falls through to the new terminal handler when the SSH side reports ok: false (non-SSH sessions don't have session.stream). Single preload method, one extra IPC round-trip only for telnet/serial, which only happens on explicit user click. - Drop the isSSHSession gate in TerminalToolbar; replace with encodingSwitchSupported = not local, not mosh, not localhost-PTY. - Terminal.tsx onSessionAttached now syncs the initial encoding for every protocol that supports it (same gate as the toolbar), not only SSH. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ai): decode serial exec output with iconv for non-Buffer encodings Codex flagged (#812 P1) that session.serialEncoding can now be an iconv-only label like gb18030 after a user switches encoding via the new terminal toolbar menu. execViaRawPty then called data.toString(encoding) on the raw Buffer, which throws "TypeError: Unknown encoding" for anything outside Node's utf8/latin1/ascii/utf16le set. The throw landed inside the data listener so Catty Agent / MCP serial exec calls failed and, worse, the uncaught path could destabilize the process. Route the decode through a small decodeBufferAs helper: Node encoding labels still use Buffer.toString for speed; anything else falls back to iconv-lite (which already handles the toolbar's GB18030). A last- resort utf8 fallback keeps the listener from throwing even if iconv itself rejects an unrecognized label. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(terminal): don't overwrite telnet/serial charset on session attach Codex flagged (#812 P1) that extending onSessionAttached to sync the UI encoding for telnet and serial sessions corrupts any host charset outside the toolbar's two values. terminalEncodingRef is derived from a useState that only ever resolves to 'utf-8' or 'gb18030', so a host configured with latin1 / shift_jis had its correct decoder immediately clobbered with one of those two as soon as the session attached. SSH is the only protocol that actually needs this sync: its backend starts in utf-8 regardless of host.charset. startTelnetSession and startSerialSession already apply options.charset through normalizeTerminalEncoding, so leaving them alone keeps arbitrary iconv labels intact; the toolbar's runtime switch remains the path for users who do want to flip to UTF-8 / GB18030 mid-session. Restore the SSH-only gate on the sync and document why the new protocols are intentionally excluded. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * style(terminal): align encoding menu rows with the rest of the popover The encoding section used a different template from every other row in the overflow menu: an uppercase "TERMINAL ENCODING" section header, then two indented rows with a leading check mark instead of a leading icon. Next to Open SFTP / Scripts / Terminal settings it read as a different component and made the popover feel disjointed. Drop the section header and render both encoding options as plain menuItemClass rows — Languages icon on the left to match the Zap / Palette leading-icon pattern, label in the flex-1 slot, and the active row gets a trailing Check in place of a right-side accessory. A single divider above them still groups the choice visually without the uppercase label. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * style(terminal): collapse encoding picker into a proper submenu The previous pass put UTF-8 and GB18030 as flat rows under a separator inside the main overflow popover. It matched the top rows better but still looked like a disjoint block of two choices stuck at the bottom. Turn the encoding picker into a nested submenu so the parent popover stays a flat list of actions and the choice lives behind a single row that mirrors the other menu items exactly: Languages icon on the left, t("terminal.toolbar.encoding") label in the flex slot, the current value as a muted caption, and a ChevronRight to signal the submenu. The submenu itself is a second Popover anchored to the right of the parent. Both popovers are now controlled so picking a value closes the whole chain in one click, and the parent's onInteractOutside ignores clicks that land in the submenu portal — otherwise Radix would treat the submenu click as "outside" the parent and dismiss it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(terminal): drop hostname gate, simplify encoding row label Two issues in one pass: 1. Codex P2 (#812): encodingSwitchSupported still hard-disabled the menu when host.hostname === 'localhost'. That was a leftover from when the only "local" escape hatch was hostname-based, but it incorrectly blocks telnet / SSH sessions aimed at localhost (test daemons, forwarded endpoints) which do have a real backend decoder we can drive. The isLocalTerminal / isMoshSession gates already cover the true local PTY and mosh cases — drop the hostname check. 2. UI: the submenu trigger carried the current value as a muted caption next to the label. At w-48 the row ran out of room and truncated "Terminal Encoding" to "Terminal Enc...". Since the submenu already marks the active choice with a check, the caption is redundant. Remove it so the full label fits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ai): stream-decode serial output with a stateful per-command decoder Codex flagged (#812 P2) that decoding each serial data event with a stateless decodeBufferAs call corrupts multi-byte characters on GBK/GB18030 consoles: serial ports deliver chunks at arbitrary byte boundaries, so the leading half of a 2-byte char in one event gets emitted as replacement bytes before the trailing half ever arrives. Build a stateful decoder once per execViaRawPty call (StringDecoder for Node-native encodings, iconv.getDecoder for iconv-only labels like gb18030) and feed every chunk through decoder.write(). On finish, decoder.end() flushes any partial bytes the decoder is still holding into the final output before it's handed back to the caller. Strings pass through untouched, same as before. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(terminal): sync SSH encoding on localhost sessions too Codex flagged (#812 P2) that dropping the 'localhost' check from the toolbar's encodingSwitchSupported gate left an inconsistency: Terminal.tsx onSessionAttached still skipped setSessionEncoding when host.hostname === 'localhost', so a user could pick GB18030, reconnect a localhost SSH tab, and the backend would restart in utf-8 while the UI still showed GB18030 — mojibake until manually toggled again. Drop the hostname clause from the isSSH check here as well. SSH to localhost is still a real SSH session whose backend starts in utf-8; the sync is what keeps the UI's picked encoding aligned across reconnects. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(terminal): re-sync telnet/serial encoding after user opt-in Codex flagged (#812 P2) that the SSH-only sync left telnet/serial with a silent UI/backend mismatch across reconnects: a user picks GB18030, the tab disconnects and retries, startTelnetSession/startSerialSession re-apply host.charset, and the UI still shows GB18030 — garbled output until the user toggles again. An unconditional sync isn't right either (earlier review: it would clobber arbitrary host.charset values like latin1 / shift_jis that the UI's two-value state can't represent). Track whether the user has actually clicked the toolbar menu this session via userPickedEncodingRef — once set, any subsequent onSessionAttached for telnet/serial re-applies the picked value; on first attach with no user action the backend's configured charset stays intact. SSH keeps the unconditional sync (its backend always starts in utf-8, so there's no configured charset to preserve). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
b9e9a0d59c |
feat(editor): promote SFTP text editor into top-level tabs (#631) (#808)
* chore: ignore local .worktrees/ directory Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(editor): editorTabStore scaffold with single-tab ops Implements the EditorTabStore class singleton (matching activeTabStore pattern) with updateContent, markSaved, setWordWrap, setSavingState, close, and subscribe. Includes useSyncExternalStore hooks and 6 passing unit tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(editor): editorTabStore promoteFromModal with per-session path dedup * feat(editor): confirmCloseBySession for session teardown Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(sftp): writeTextFileByConnection for pane-agnostic saves Adds a new `writeTextFileByConnection(connectionId, expectedHostId, filePath, content, filenameEncoding?)` method to `useSftpExternalOperations` that looks up the SFTP pane by connection ID (with a hostId safety check) instead of the left/right-side coupling used by `writeTextFile`. Threads the existing `getPaneByConnectionId` callback through the call site and re-exports the new method via `SftpStateApi`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(editor): editorSftpBridge singleton for out-of-React saves Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(editor): extract TextEditorPane from TextEditorModal Lift Monaco editor body + toolbar + theme sync + paste fallback into a pure TextEditorPane component. Adds sftp.editor.maximize i18n key to en.ts and zh-CN.ts locale files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(editor): drop unused getLanguageId import in TextEditorPane Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(editor): TextEditorModal delegates to TextEditorPane Replace the monolithic modal (560 lines including full Monaco setup) with a thin Dialog shell (~150 lines) that owns content/saving/saveError/ languageId state, save orchestration, and dirty-check on close, then delegates all editor chrome to <TextEditorPane chrome="modal" />. Exports TextEditorModalSnapshot for the optional onPromoteToTab callback so callers can later wire tab promotion (Task 12) without breaking the existing interface — the new prop is optional and existing callers (SftpOverlays.tsx) are source-compatible with zero changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(editor): include fileName and wordWrap in TextEditorModalSnapshot Task 12 will populate the promoted tab with these fields, so the snapshot must carry them from the modal at maximize time. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(editor): UnsavedChangesDialog three-button confirm * fix(editor): resolve UnsavedChangesDialog re-entrance and unmount leaks - Re-entrance: if prompt() is called while a prior prompt is still pending, cancel the prior one so its caller doesn't hang forever. - Unmount: resolve any in-flight prompt as "cancel" in the effect cleanup so awaiters don't leak when the provider unmounts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(editor): TextEditorTabView tab-form shell Add TextEditorTabView component that binds an editorTabStore entry to TextEditorPane, with CSS display:none toggling for inactive tabs so the Monaco instance persists across tab switches. Also adds setLanguage public method to EditorTabStore (lands Task 15's intent early — Task 15 can be a no-op). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(editor): read live store state in TextEditorTabView handlers React state snapshot lags the store by a microtask. Closing over `tab` meant a keystroke between Monaco's onChange and a Ctrl+S would write stale content and mark a stale baseline. Read via editorTabStore.getTab at call time instead. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(editor): dispatch editor:* tab ids in App and activeTabStore - Add EDITOR_PREFIX, isEditorTabId, toEditorTabId, fromEditorTabId helpers - Add useIsEditorTabActive hook to activeTabStore - Update useIsTerminalLayerVisible to exclude editor tabs - Import useEditorTabs and TextEditorTabView into App.tsx - Append editor tab ids (editor:<id>) to allTabs in hotkey handler - Mount TextEditorTabView per editorTab with CSS visibility toggling - Add editorTabs to executeHotkeyAction useCallback dependency array Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(editor): render editor tabs in TopTabs with icon/dirty/tooltip - Add `fromEditorTabId`, `isEditorTabId` imports to TopTabs.tsx - Add `FileCode`, `FileText` icons; use FileCode for code-like extensions - Extend `TopTabsProps` with `editorTabs`, `onRequestCloseEditorTab`, `hostById` - Build `editorTabMap` for O(1) lookup; add `editor` branch in `orderedTabItems` - Render editor tab chrome matching terminal tab style: file icon, dirty dot (●), filename with disambiguation suffix for duplicate filenames, close button - In App.tsx: add stub `handleRequestCloseEditorTab`, `orderedTabsWithEditors`, pass new props to `<TopTabs>` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(editor): hoist editor-tab code-extension regex and use onSelectTab - Move CODE_EXTENSIONS_RE to module scope so it isn't recompiled per render. - Call onSelectTab(tabId) for consistency with other tab types, instead of reaching into activeTabStore directly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(editor): maximize modal to tab and dirty-confirm tab close Wire onPromoteToTab from TextEditorModal through SftpOverlays and useSftpViewFileOps so clicking the maximize button snapshots editor state into editorTabStore and activates the new editor tab. Replace the stub handleRequestCloseEditorTab in App.tsx with a real dirty-confirm flow using UnsavedChangesProvider render-prop: clean tabs close immediately, dirty tabs prompt save/discard/cancel, and save routes through editorSftpBridge with markSaved on success. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(editor): register SFTP bridge and gate session close on dirty editor tabs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(editor): make onDisconnect async so host-picker waits for dirty check The session-close dirty gate added in Task 13 made onDisconnect async, but the host-picker in SftpPaneDialogs still called it synchronously before kicking off onConnect — a fire-and-forget that raced past the dirty prompt and let unsaved editor tabs slip through. Propagate the Promise return type through SftpPaneCallbacks / SftpPaneDialogs / useSftpViewPaneActionsResult and await it at the host-picker call sites. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(editor): block app quit while editor tabs are dirty Add a before-quit IPC guard that asks the renderer whether any editor tab has unsaved changes. If dirty tabs exist, preventDefault() blocks the quit and a warning toast is shown. The app quits normally once editors are clean. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(editor): add 5s timeout fallback to quit-guard IPC check If the renderer crashes or throws before reporting back, the quitGuard would stay busy forever and the app could not be quit. Fall back to force-quit after 5 s if no reply arrives. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(editor): quit-guard uses quitConfirmed flag to prevent re-entry loop The prior flow reset quitGuardChannelBusy before calling app.quit(), which on macOS re-fires before-quit and re-entered the dirty check with the flag cleared — creating an infinite IPC loop. Introduce a separate quitConfirmed flag that commits to quitting before app.quit() fires, so the re-entry takes the fast path. Also extract QUIT_GUARD_TIMEOUT_MS and clarify that a concurrent quit while a check is in flight is swallowed (preventDefault) rather than letting the second event through. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(editor): use absolute inset-0 for tab panel and add sr-only DialogTitle Two bugs surfaced during the first dev-server smoke test: 1. Editor tab content was blank because TextEditorTabView used only className="h-full", while its sibling panels (VaultView, SftpView, TerminalLayerMount, LogView) all fill their flex-1 parent via `absolute inset-0`. In normal flow the editor tab collapsed to zero height. Match the sibling convention. 2. Radix printed an accessibility warning because the Task 7 refactor pulled the DialogTitle out of DialogContent and into the Pane header (now a plain span). Add a visually hidden DialogTitle that mirrors the filename, so screen readers have a title without showing it twice. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(editor): raise tab panel z-index to 20 so it sits above TerminalLayer TerminalLayer's root is visibility:hidden when the active tab is an editor tab, but its inner panels set `absolute inset-0 z-10` on their own and those still paint. Without an explicit z on the editor tab panel, TerminalLayer's inner bg-background div was covering the Monaco content, producing a blank screen. Also add bg-background to the wrapper so the editor tab paints an opaque surface (matches the pattern VaultViewContainer / TerminalLayer follow). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(editor): show host label and remote path next to filename in tab header The editor tab form previously only showed the bare filename in its header, which is ambiguous when the same filename is open against multiple hosts. Add an optional subtitle prop on TextEditorPane and populate it from the tab form with `<hostLabel>:<remotePath>` rendered in muted text beside the filename. The modal keeps its existing filename-only header. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(editor): bridge supports multiple useSftpState instances useSftpState is instantiated in both the top-level SftpView and the terminal's SftpSidePanel, each owning its own pane registry. The editor bridge previously stored only one writer, so maximizing a file opened from the terminal side panel registered nothing (bridge was owned by SftpView which may never have mounted) and save failed with "bridge not registered". Change the bridge to track a Set of writers and dispatch by trying each until one owns the connectionId (signalled by its specific "connection no longer available" error). Add registerEditorSftpWriterScoped that returns an unregister fn so each instance's cleanup removes only its own entry. Register in both SftpView and SftpSidePanel. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(editor): Cmd+W closes editor tab + terminal close forces tab close Two behaviors added after user feedback from dev-server smoke-test: 1. Cmd/Ctrl+W (the closeTab hotkey) previously did nothing on editor tabs because executeHotkeyAction had no branch for editor:* ids. Add one that reaches into the UnsavedChangesProvider render-prop's close flow via a ref, routing through the existing dirty-confirm path. 2. Closing a terminal tab unmounts its SftpSidePanel which destroys the useSftpState instance that owned the connection. Any editor tab promoted from that panel would then be stuck — bridge gone, save channel dead. On SftpSidePanel unmount, gather the connection ids it owned and call a new editorTabStore.forceCloseBySessions to drop matching editor tabs. Dirty state is dropped because the user closed the terminal knowing the file was open — there is no save channel left anyway. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(editor): Cmd/Ctrl+W works when focus is inside Monaco Monaco's internal key-event dispatcher swallows keydown before the capture-phase handler on the Pane's root div can see it, so the global hotkey dispatcher never got the chance to close the editor tab when the editor had focus. Register a Monaco editor command for the close-tab keybinding and route it through a handleCloseRef — mirrors the same pattern used for Cmd/Ctrl+S. Also drop the modal-only guard in the capture-phase handler so the outer-chrome path works in tab mode too. TextEditorTabView now receives an onRequestClose(tabId) prop that App.tsx wires via the render-prop-exposed handleRequestCloseEditorTabRef, same mechanism as the hotkey-dispatcher path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(editor): fall back to Vaults when forceCloseBySessions removes the active tab Closing a terminal tab triggers SftpSidePanel unmount which force-closes its editor tabs. If the editor tab being removed happened to be the active tab (user maximized → then closed the owning terminal from another path), the app ended up on a stale activeTabId with no selected tab and blank content. Inside forceCloseBySessions, if the active tab was one of the removed editor ids, redirect to 'vault'. Picking a more sophisticated neighbor would need the full orderedTabs list which isn't reachable from this layer; Vaults is always valid. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
8ef91e1266 |
Ctrl+W close priority + local shell busy confirmation (#739)
* feat(ctrl-w): add ps-node + windows-process-tree + tsx deps for close-priority feature * fix(ctrl-w): drop ps-node dep and add windows-process-tree to asarUnpack Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): add ptyProcessTree bridge with per-platform child-process enumeration Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ctrl-w): ptyProcessTree uses args= for full command + warns on pid overwrite - Replace `comm=` with `args=` in defaultListPosix so the full command line is captured on both macOS (BSD ps) and Linux (GNU ps), avoiding the 15-char TASK_COMM_LEN truncation. - Add console.warn in registerPid when the same sessionId is overwritten with a different pid, making the race condition visible in logs. - Add test: registerPid warns exactly once on a pid change, not on a same-pid re-registration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): register local PTY pid with ptyProcessTree on spawn/exit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ctrl-w): unregister pids in cleanupAllSessions to match per-delete invariant Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): add IPC handlers for pty child processes and confirm-close dialog Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ctrl-w): guard BrowserWindow.fromWebContents null and document dialog dismiss contract Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): expose ptyGetChildProcesses and confirmCloseBusy on window.netcatty Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): add i18n strings for close-busy-terminal dialog Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): add resolveCloseIntent pure function with 8 unit tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): expose handleCloseSidePanel via ref to App.tsx Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): wire resolveCloseIntent + local-shell busy confirmation into closeTab hotkey Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(ctrl-w): add re-entrancy guard, aggregate busy count, sync sidebar ref, dedupe intent branches Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): auto-close workspace when its last session is closed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ctrl-w): sidebar close wins over focused terminal in priority chain Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ctrl-w): sidebar priority applies to single-session tabs too, not just workspaces Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ctrl-w): compute empty-workspace auto-close outside setSessions updater Addresses Codex P2 on #739: React 18+ does not guarantee updater execution timing under concurrent scheduling. Moving the decision outside the updater makes the microtask queue deterministic. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|
|
db69d5ac39 |
[codex] Harden sync overwrite protection and add local restore history (#720)
* fix: harden sync overwrite recovery * refactor: separate backup retention settings * refactor: align backup retention controls * refactor: simplify backup retention card * fix: address PR #720 deep-review findings - Close the cross-window restore race by holding a time-bounded barrier in localStorage during every destructive apply; useAutoSync skips pushes while it's set, preventing a pre-restore snapshot from clobbering just-restored cloud data. - Round-trip startup three-way merges so merged-in local additions actually reach the cloud instead of living only on the device that ran the merge until the next edit. - Upgrade sync signatures from a 64-char ciphertext prefix to full SHA-256 (v3), closing the tail-mutation replay weakness. - Harden the vault-backup IPC: payload size cap, enum-validated reason, sanitized version strings, strict maxCount, concurrent-call mutex, monotonic createdAt to avoid same-ms ordering ties. - Extract the anchor-change decision into a pure module with unit tests covering no-anchor, resource-id drift, and signature mismatch paths. - Capture the protective backup from the pre-apply closure snapshot so it reflects what's being replaced rather than what was imported. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address PR #720 follow-up review findings Make protective backup abort-on-failure (was best-effort console.error), preserve nested syncedAt in fingerprint, use UTF-8 byte length for size guard, throw on conflict-inspect failure so stale uploads can't leak through, treat unreadable remote as changed, canonical-JSON signature meta, and hold the version stamp on transient backup failures so the retry path still fires. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address second-pass review findings on PR #720 - Hold version-change stamp when payload is non-meaningful (covers the startup vault-rehydrate race where a transient empty snapshot would permanently skip the upgrade backup). - readBackupRecord stat-checks before readFile so an oversized file in the backup dir cannot OOM the renderer on enumeration. - Reject maxBackups input outside 1..100 instead of silently clamping (matches the i18n error copy and the main-process sanitizer bound). - Wrap USE_LOCAL conflict-resolution push in withRestoreBarrier so a concurrent auto-sync in another window cannot interleave. - sha256Hex throws SyncSignatureUnavailableError on missing WebCrypto subtle; createSyncedFileSignature returns null, forcing the unreadable-remote → three-way-merge path instead of a weak length-only pseudo-signature. - Document that array order in normalizePayloadForHash is an invariant enforced by producers, not the hash function. - Drop three-way-merge completion logs from console.log to console.info. - Comment the implicit restore → store-listener refresh chain so future refactors don't silently break the UI reload path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address third-pass review findings on PR #720 Resolves I-3 through I-8 and related cleanup items identified in the deep review. Highlights: - replace setTimeout(0) post-merge round-trip with a direct syncAllProviders call using the already-computed merged payload, removing the React-commit race - resolve the empty-vault confirmation promise on unmount so a mid-dialog window teardown doesn't leak the resolver - retry the version-change backup as hosts/keys hydrate, instead of latching on the first (possibly empty) snapshot - heartbeat-refresh the cross-window restore barrier so long applies cannot expose a post-60s window to concurrent auto-sync - add a diagnostic warning when connected providers hold divergent bases (multi-account configurations) - surface a user-visible "Sync paused" toast when startup inspect fails, replacing the previous silent gate-open - tie-break backup list sort by id when createdAt collides - extract applyProtectedSyncPayload so the main and settings windows cannot drift on restore-barrier / protective-backup handling Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address deep-review findings on PR #720 Deep re-review surfaced six Important issues that survived the prior four review rounds. All are hardened here: - I1: fsync the protective backup file AND its directory before the rename completes, so a system crash between backup creation and the restore it guards cannot leave a torn/zero-length safety net. - I3: persist an apply-in-progress sentinel across the non-atomic localStorage writes in applySyncPayload. A crash mid-apply now surfaces on the next startup (toast + refuse auto-push) instead of silently pushing the half-applied state over an intact cloud copy. - I2: only open the auto-sync gate (remoteCheckDoneRef) when the startup inspect validated cleanly. Add a bounded exponential-backoff retry so a transient inspect failure self-heals instead of wedging auto-sync until restart. - I5: save the sync base BEFORE advancing the per-provider anchor inside uploadToProvider. A renderer crash between the two writes now degrades to "stale anchor forces re-inspect on next run," which re-merges against the fresh base — eliminating the silent base-drift window where a 3rd-device race could misclassify entries. - I6: main process broadcasts a vaultBackups:changed IPC event on every mutation; useLocalVaultBackups subscribes so protective backups created from the main window show up in the Settings backup list without manual refresh. - I4: update PR description + code comment to match the actual (safer) design: auto-sync gate opens on vault init, with hasMeaningfulSyncData + restore barrier preventing empty-push; the version-change backup is best-effort and retries as data hydrates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: serialize startup checkRemoteVersion and stabilize its deps Re-review flagged that checkRemoteVersion's useCallback depended on `config` — a fresh object literal from App.tsx on every render — so the retry effect restarted with attempt=0 on every vault edit and could spawn overlapping in-flight inspect+apply runs. Two concurrent commitRemoteInspection + onApplyPayload calls could race on the apply-in-progress sentinel around interleaved writes. Route `buildPayload`, `config.onApplyPayload`, and `config.startupReady` through refs so checkRemoteVersion's identity no longer churns with unrelated App state. Add an in-flight guard that returns early when a previous invocation is still awaiting the network, closing the same-window re-entry gap that withRestoreBarrier intentionally doesn't cover. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: release in-flight lock on no-connected-provider early return Third-pass review caught that `checkRemoteInFlightRef` was acquired before the `!connectedProvider` check, so that early return leaked the lock and every subsequent retry-timer tick silently no-op'd. Move the acquisition past the early return so the only path that takes the lock reaches the finally-release. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
af2589e60b |
Merge pull request #704 from tces1/MoreSkills
feat: add Netcatty user skills scanning and chat selection flow |
||
|
|
1c9c4fcec3 |
fix: address second-round review feedback
- Extract fail-loud check to shared getCodexCustomConfigPreflightError so
the list-models handler (aiBridge.cjs:2149) enforces the same up-front
error as the stream handler. Previously a user whose config.toml
env_key was unexported would get the targeted message on chat send but
a generic "Missing env var" from model-list probes (once the probe was
rewired for Codex in a future change).
- Wire Settings "Refresh Status" to also invalidate the shell-env cache.
New invalidateShellEnvCache() helper in shellUtils; aiCodexGetIntegration
now accepts an optional { refreshShellEnv } flag; the button passes it
so a user who just exported OPENROUTER_API_KEY in their rc file can
click Refresh instead of having to restart netcatty.
- Declare authHash in CodexCustomProviderConfig (types.ts + global.d.ts)
so renderer TS actually sees the field instead of needing a cast.
- DRY the 360 magic number in ChatInput: extract
MODEL_PICKER_MAX_WIDTH, use it in both the className max-width and the
left-clamp math so the two can't drift.
- Move codexCustomConfigResolved useState declaration next to its
companion codexConfigModel, above the effect that invokes its setter,
and drop the duplicate declaration further down. Pure code-organization
cleanup but removes a use-before-declaration nit.
No functional changes beyond the fail-loud parity and the refresh-shell-env
path. ACP behavior when authMethodId is omitted still requires a
real-world OpenRouter config.toml validation, which the user is running.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|
|
58bc08a045 | Add user skills injection and picker UI | ||
|
|
c771979178 |
Add Skills + CLI mode for external agents (#599)
* Add Skills + CLI external agent workflow * feat: add Skills + CLI transport for ACP agents * chore: remove branch-local compatibility shims |
||
|
|
e8b9122270 |
feat: auto-detect network devices from SSH banner and skip stats polling (#680)
* feat: auto-detect network devices from SSH banner and skip stats polling (#674) Fixes rapid AAA session churn reported on Cisco/HPE/similar network devices running Netcatty. The root cause was two separate polls that both open fresh exec channels (each counted as its own AAA session on many network devices): - runDistroDetection() opens a brand new SSH connection every time a host connects to run `cat /etc/os-release || uname -a` - useServerStats polls `conn.exec(statsCommand)` every 5 seconds Both commands fail on non-POSIX CLIs, but the channels still hit AAA. This change avoids both by reading the SSH server identification string that ssh2 already captures during the handshake (`conn._remoteVer`). No extra network round-trips, zero additional AAA entries. ## Changes **sshBridge.cjs** - Store `conn._remoteVer` on the session object at connect time as `session.remoteSshVersion` - New IPC handler `netcatty:ssh:remoteInfo` (`getSessionRemoteInfo`) returning the captured SSH server software string **preload.cjs / global.d.ts / useTerminalBackend.ts** - Thread `getSessionRemoteInfo(sessionId)` through to the renderer **domain/host.ts** - `NETWORK_DEVICE_OPTIONS` constant listing the vendor IDs we can recognize (cisco, juniper, huawei, hpe, mikrotik, fortinet, paloalto, zyxel) - `detectVendorFromSshVersion()` — pure function that parses an SSH server software string and returns a vendor ID or ''. Pattern set is sourced from Nmap nmap-service-probes (authoritative), the ssh-audit software.py reference, and vendor docs; see code comments for the exact matches used. - `classifyDistroId()` returns `linux-like | network-device | other` so features that require a POSIX shell can gate on the result. **createTerminalSessionStarters.ts (runDistroDetection)** - Before running the /etc/os-release probe, call `getSessionRemoteInfo` on the already-connected session and feed the banner into `detectVendorFromSshVersion`. If the vendor maps to a known network device, emit the vendor ID via the existing `onOsDetected` callback and skip the shell probe entirely. For unknown or generic OpenSSH/Dropbear banners the existing behavior is preserved. **Terminal.tsx** - `isSupportedOs` now derives from `classifyDistroId(effectiveDistro)` combined with `host.deviceType !== 'network'`, so neither explicit network-device hosts nor banner-detected ones trigger the stats polling loop. **useServerStats.ts** - Add a consecutive-failure counter. After 3 consecutive failed polls, stop the interval for this session (reset on disconnect / sessionId change / settings toggle). This is the fallback for hosts the banner classifier cannot identify (Juniper JUNOS, Cisco NX-OS, Arista EOS — all present as plain `OpenSSH_*` but do not support the POSIX stats pipeline). **DistroAvatar.tsx / HostDetailsPanel.tsx** - Add 8 network-device vendor icons (Cisco, Juniper, Huawei, HPE, MikroTik, Fortinet, Palo Alto, ZyXEL) alongside the existing Linux distro icons, with brand colors. Icons sourced from Simple Icons (CC0) where available; HPE and ZyXEL use simple abbreviation placeholders. - Network device vendors are added to the manual distro override dropdown so users can pin an icon even if their device has an exotic banner we don't auto-detect. **i18n** - English + Chinese labels for the new vendor options in the Host Details distro selector. Closes #674 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: gate network-device detection on raw host.distro, not manual icon override Per Codex review on PR #680: the stats-polling gate was passing `host` through getEffectiveHostDistro() before classifying, which honors the manual distro override (`distroMode: 'manual'` + `manualDistro`). That meant a user who previously pinned an "ubuntu" icon on a host that later gets banner-detected as Cisco would still be classified as linux-like and keep generating the AAA session flood #674 is meant to eliminate. Separate display from gating: - Display (DistroAvatar, host cards): keeps using getEffectiveHostDistro so users can cosmetically override the icon. - Gating (useServerStats via Terminal.tsx isSupportedOs): reads host.distro directly — the value populated by banner detection — alongside the explicit host.deviceType flag. Manual icon choice can no longer re-enable polling on a detected network device. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: guard distro detection against stale session timers Per Codex review on PR #680: runDistroDetection is scheduled on a 600ms setTimeout after connection and also makes async calls of its own. A quick disconnect + reconnect on the same session slot could fire the old timer against the new session, reading host B's SSH banner via getSessionRemoteInfo and writing host B's vendor onto host A's distro field — wrong icon and wrong stats-polling state. Follow the same pattern already used for the startup-command timer in this file (scheduledSessionId captured at schedule time, checked inside the timer). Capture `id` at schedule time, bail out if ctx.sessionRef.current no longer matches, and re-check after every async await inside runDistroDetection so that a reconnect during the banner fetch or the os-release probe also bails cleanly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address local codex review on PR #680 Addresses three issues found in a local Codex review pass after the remote reviewer gate was flaky: ## P0 — session tokens instead of sessionId for stale-timer guard The previous guard captured `id` returned from startSSHSession and compared against `ctx.sessionRef.current` inside the setTimeout and the async runDistroDetection. But the renderer passes `sessionId: ctx.sessionId` into startSSHSession (see createTerminalSessionStarters.ts:543), meaning a tab reuses the SAME sessionId across disconnect+reconnect. The comparison `T1 === T1` always passed, so the guard was a no-op. Replaced with a module-level Map<sessionId, object> that stores the live "connection token" for each sessionId slot. Each call to startSSH mints a fresh `{}` token and overwrites the entry. Timers and async continuations compare their captured token against the current map value by reference — a reconnect replaces the map entry with a new token, so stale callbacks bail cleanly. ## P1 — run os-release probe on the existing SSH connection The fallback /etc/os-release probe used `execCommand` which creates a brand-new SSHClient() on every call. On network devices that present as plain `OpenSSH_*` and fall through to this step (JUNOS, NX-OS, EOS) it added one extra full-auth AAA session log entry per connect, in addition to the failing stats polls. Added `getSessionDistroInfo(sessionId)` as a new IPC handler that runs the same probe via `session.conn.exec()` — an exec channel on the already-open connection, no new handshake. Plumbed through preload.cjs, global.d.ts, and useTerminalBackend.ts. runDistroDetection uses this instead of execCommand in the fallback path, also removing the unused auth-credentials argument (we are no longer opening a new connection, so no credentials are needed). ## P2.1 — don't re-arm timers after giving up After the consecutive-failure counter trips, useServerStats cleared the interval but a subsequent effect rerun (visibility change, settings tweak, etc.) would schedule a fresh `setTimeout` and `setInterval` that would just call the early-return path forever. The scheduling block now checks `givenUpRef.current` before arming either timer. The flag is still cleared on the normal disconnect / sessionId-change reset path so a reconnect gets a fresh attempt. ## P2.2 — drop the ambiguous IPSSH-* → cisco mapping Nmap's `match ssh m|^SSH-([\d.]+)-IPSSH-` line is labelled as `Cisco/3com IPSSHd` — it cannot identify a specific vendor from the banner alone. Mapping it to `cisco` would risk showing the wrong vendor icon on a 3Com device. Removed the rule entirely and documented why with a code comment; users with such devices can still use the Host Details manual distro override. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address remaining gaps from local codex follow-up review P0 gap — delete connection token on session exit. Previously the map entry lingered after disconnect, so a very late-firing timer could still pass the isConnectionTokenCurrent check even though the session no longer existed. Functionally harmless (the IPC calls would fail) but semantically wrong. Now connectionTokensBySessionId.delete() is called in the onSessionExit handler. P1 new — exec channel leak on timeout in getSessionDistroInfo. The timeout branch resolved the promise but didn't close the stream, so a hanging remote command would leave the exec channel open until the SSH connection itself dropped. Added a settled guard (resolve-once) and stream.close() on timeout. P2.1 gap — givenUpRef not reset on sessionId change. The failure counter reset only happened in the !isConnected branch of the main effect, so a sessionId swap while still connected (rare, but possible if the tab reconnects without toggling connected state) would permanently suppress polling. Added a small dedicated effect that resets both counters when sessionId changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
6ac36be04b | feat: local shell selection with auto-discovery (#605) | ||
|
|
308d825db7 |
feat: ZMODEM (lrzsz) file transfer support (#579)
* feat: add ZMODEM (lrzsz) file transfer support for terminal sessions Adds ZMODEM protocol detection and file transfer capability to all terminal session types (Local, SSH, Telnet, Mosh, Serial). Uses zmodem.js library with main-process sentry pattern to intercept binary data before string decoding, avoiding IPC pipeline changes. - zmodemHelper.cjs: shared ZMODEM sentry with Electron dialog integration - terminalBridge.cjs: encoding:null for PTY + sentry wrappers for all session types - sshBridge.cjs: sentry wrapper for SSH stream data - preload.cjs + global.d.ts: ZMODEM event IPC bridge and TypeScript types - useZmodemTransfer.ts: React hook for ZMODEM transfer state Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: preserve charset decoding and add ZMODEM progress UI - zmodemHelper: pass raw Buffer to onData, let callers handle decoding - terminalBridge: use StringDecoder for telnet/serial, UTF-8 for local/mosh - sshBridge: restore iconv decoder for SSH session charset support - ZmodemProgressIndicator: floating progress bar with cancel button - Terminal.tsx: wire useZmodemTransfer hook + toast notifications Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: ZMODEM listener cleanup, stream leak, and toast dedup - preload: clean up zmodemListeners on session exit (memory leak) - zmodemHelper: add ws.on('error') handler to close write stream on failure - Terminal: use ref guard to prevent duplicate toast notifications Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address code review findings for ZMODEM - cancel/consume error now send IPC event to renderer (prevents stuck UI) - sanitize download filename with path.basename (path traversal prevention) - add on_detect concurrency guard (deny if transfer already active) - formatBytes: handle negative, zero, and TB+ values safely - closeSession: cancel active ZMODEM before destroying transport Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: prevent double-notification on cancel and stream error resilience - Guard .then()/.catch() in promise chain: skip if cancel() already handled - Download: add writeAborted flag to stop on_input after stream error - Upload: pre-compute file stats to avoid O(N²) statSync calls Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use zsession.abort() instead of close() on dialog cancel close() is only available on Send sessions. Calling it on a Receive session throws, leaving the sentry's internal _zsession dangling and causing subsequent terminal data to be consumed by the abandoned ZMODEM session (terminal freeze). abort() is defined on the base ZmodemSession class and properly fires session_end to reset the sentry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: handle ZFIN/OO mismatch as successful transfer When sz exits over SSH, the shell prompt often arrives before the ZMODEM "OO" end marker, causing zmodem.js to throw a protocol error. Since ZFIN was already exchanged (= all file data transferred), treat this specific error as a successful completion and forward the shell prompt data back to the terminal via sentry re-consume. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: codex review — UTF-8 decoder, ZFIN abort, session exit cleanup - terminalBridge: use StringDecoder for local/mosh PTY to handle multi-byte UTF-8 split across buffer boundaries (prevents garbled CJK/emoji output) - zmodemHelper: on ZFIN/OO success path, use _on_session_end() instead of abort() to avoid sending CAN (Ctrl-X) bytes to the remote shell - useZmodemTransfer: listen to onSessionExit to reset state when the session dies mid-transfer (prevents stuck progress indicator) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: codex review — file collision handling and stream flush - Download: auto-rename with (1), (2), etc. if file already exists in the target directory, preventing silent overwrite - Download: wait for all write streams to finish flushing before resolving the session_end promise, ensuring data is on disk when the UI reports completion Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: codex review — Windows PTY string compat and Telnet binary safety - Local/Mosh PTY: handle string data from Windows node-pty which ignores encoding: null; convert to Buffer before sentry.consume() - Telnet: bypass IAC negotiation during active ZMODEM transfer to preserve 0xFF bytes in binary data - Telnet writeToRemote: escape 0xFF as 0xFF 0xFF per Telnet spec so ZMODEM binary data is not treated as IAC commands Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: codex review — Windows PTY guard, Telnet IAC, stream cleanup - Local/Mosh: skip ZMODEM sentry on Windows where node-pty can't provide raw bytes; fall back to original string pipeline - Telnet: always run IAC negotiation (even during ZMODEM) since the Telnet layer still escapes 0xFF as IAC IAC; the existing handler already correctly collapses IAC IAC → single 0xFF - Download: destroy un-ended write streams on session_end to prevent hanging promises and leaked file descriptors on abort Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: codex review — early session start, progress throttle, no dup start - Download: call zsession.start() before showing folder picker dialog so lrzsz doesn't time out waiting for ZRINIT - Download: throttle progress IPC to ~10 updates/sec (100ms interval) to avoid overwhelming renderer on fast links - Download: remove duplicate zsession.start() at bottom of Promise Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: handle ZRPOS and prevent terminal flood after ZMODEM abort - Add 500ms cooldown after ZMODEM abort: suppress residual protocol bytes from remote rz/sz that would otherwise flood the terminal - Send 8x CAN (Ctrl-X) on abort/cancel/error to force remote end to stop transmitting even if the initial abort sequence was lost - Handles "Unhandled header: ZRPOS" gracefully (zmodem.js doesn't support error recovery, so abort is the correct response) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: send Ctrl+C after abort in all cancel/error paths Debian's rz stays attached to the TTY after receiving CAN sequences. The cancel() path already sent Ctrl+C via scheduleRemoteInterruptAfterCancel, but dialog-cancel and consume-error paths did not. Now all three abort paths (dialog cancel, consume error, explicit cancel) send Ctrl+C after 150ms to ensure the remote rz/sz process exits and the shell regains control. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add interruptRemote for SSH ZMODEM sentry Pass SSH stream.signal("INT") as interruptRemote callback so the ZMODEM helper can send SIGINT to the remote process when cancelling transfers, complementing the Ctrl+C byte sent via writeToRemote. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: dialog-cancel abort uses module-level helper to avoid ReferenceError sendExtraAbortBytes and writeToRemote are closure-scoped inside createZmodemSentry, not accessible from handleUpload/handleDownload. Extract abortRemoteProcess as a module-level function that takes writeToRemote as a parameter, used in both dialog-cancel paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: dialog cancel throws instead of returning to avoid false complete When user dismisses the file/folder picker, handleUpload/handleDownload now throw "Transfer cancelled" instead of returning normally. This ensures the .catch() handler fires (sending error event) rather than .then() (which would incorrectly send complete event). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: codex review — preserve transferType in progress events - useZmodemTransfer: copy transferType from progress events so the transfer direction is preserved if renderer re-subscribes after the initial detect event was missed - zmodemHelper: clean up upload loop comments (backpressure handled via 64KB chunks + setImmediate yield per iteration) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: codex review — guard stale session cleanup, delete partial downloads - Promise chain .then/.catch/.finally now compare currentZSession identity (=== zsession) instead of truthiness, preventing a new transfer from being clobbered by the old promise settling - Aborted/incomplete downloads are deleted from disk on session_end so users don't end up with corrupt partial files Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: unconditional cooldown suppression after ZMODEM abort The previous cooldown checked if data "looks like residual ZMODEM" which fails for sz's file content (arbitrary printable bytes). Now cooldown unconditionally drops ALL incoming data for 2 seconds after abort, with repeated CAN bursts to ensure the remote sz stops. This prevents the terminal flood seen when cancelling large sz downloads on fast connections. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
d9b51c3a50 | feat: add GitHub Copilot CLI agent support | ||
|
|
0b08521e63 |
perf: optimize same-host SFTP transfer with remote cp command (#564)
* perf: optimize same-host SFTP transfer with remote cp command When both panels are connected to the same remote host, use SSH exec `cp -a` instead of downloading to local temp then re-uploading. This eliminates 2x bandwidth usage and reduces latency for same-host transfers. Closes #561 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * perf: optimize same-host directory transfer with single cp -ra command For same-host directory transfers, use a single `cp -ra` command via SSH exec instead of recursively walking the directory and copying files one by one. This makes directory copies nearly instant on the remote server. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use endpoint cache key for same-host detection and guard non-UTF-8 paths Address two code review issues: 1. Compare per-connection cache keys (hostname+port+protocol+sudo+username) instead of just hostId for same-host detection. This prevents false positives when the same hostId has different session-time overrides. 2. Restrict exec-based cp paths to UTF-8 compatible encodings only. Non-UTF-8 encodings (e.g. gb18030) need encodePathForSession which shell exec cannot use — fall back to download+upload for those cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: directory cp semantics, cancellation, and auto encoding guard 1. Use `cp -ra source/. target/` instead of `cp -ra source target` to copy directory contents into target, preserving merge semantics when the target directory already exists (avoids extra nesting level). 2. Check cancellation state before and after sameHostCopyDirectory call so cancelled transfers don't finalize as completed. 3. Exclude 'auto' from exec-safe encodings since auto can resolve to non-UTF-8 (e.g. gb18030) at the session level. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: wire cancellation into same-host copy paths 1. Single file cp -a: check transfer.cancelled before and after execSshCommand so cancelled transfers don't proceed as success. 2. Directory cp -ra: accept transferId, register in activeTransfers so cancelTransfer can flag it, and check cancelled state at each async boundary. Cleanup via finally block. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: abort remote cp process on transfer cancellation Add execSshCommandCancellable() that wires the SSH exec stream into transfer.abort, so cancelTransfer can close the stream and kill the remote cp process immediately instead of waiting for it to finish. Used in both single-file (cp -a) and directory (cp -ra) same-host paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: close exec stream immediately if cancelled before callback fires Check transfer.cancelled at the start of the exec callback and close the stream right away, preventing the remote cp from running when cancellation happened between the exec() call and callback delivery. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: fallback to download+upload when remote cp is unavailable On non-POSIX remotes (e.g. Windows SSH servers) where cp is absent, same-host optimization now gracefully falls back to the existing download+upload transfer path instead of failing the transfer. - Single file: try cp -a first, fall back to temp file on non-zero exit - Directory: sameHostCopyDirectory returns { success: false } instead of throwing, frontend falls back to recursive transferDirectory Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * perf: cache cp unavailability to avoid repeated exec failures Track sftpIds where remote cp failed in cpUnavailableSet so subsequent file transfers in the same session skip the exec attempt and go directly to download+upload, avoiding per-file exec round-trip overhead on non-POSIX remotes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: skip transferFile for directories already handled by same-host copy Add !task.isDirectory guard to the else branch so successful sameHostCopyDirectory doesn't also trigger a redundant transferFile call that would duplicate data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: dereference symlinks in same-host copy to match SFTP behavior Use cp -aL instead of cp -a so symlinks are dereferenced (copied as file contents), matching the existing SFTP download+upload flow which always transfers resolved file data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * revert: remove -L flag from same-host cp to avoid recursing symlinked dirs Revert cp -aL back to cp -a. The -L flag dereferences all symlinks including symlinked directories, which can unexpectedly recurse into large unrelated directory trees. Using cp -a preserves symlinks as-is, which is safer and consistent with how the transfer UI treats symlink directories as non-recursive entries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: refine cp unavailability caching and remove dead import 1. Only cache sftpId in cpUnavailableSet on exit code 127 (command not found). Other failures (permission denied, disk full) are transient or path-specific and should not disable cp for the entire session. 2. Check cpUnavailableSet at the top of sameHostCopyDirectory to skip exec attempt on known non-POSIX remotes. Also cache 127 exits from directory copies. 3. Remove unused execSshCommand import from transferBridge (replaced by local execSshCommandCancellable) and revert its export from sftpBridge. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
6d19413025 | Display approved AI commands in terminal sessions before their output. (#546) | ||
|
|
f1fea53af6 | fix: avoid preload API collision with sftp |