Commit Graph

90 Commits

Author SHA1 Message Date
Netcatty-Bot c74daf0102 fix(#3550): automated AI fix (#3552)
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
2026-09-29 16:06:18 +08:00
bincxz 2d9890a92e fix: disarm global broadcast when orphan group disappears 2026-09-05 12:53:39 +08:00
Meow-Emperor 1ef7b026a6 Enable global broadcast for orphan terminal tabs
Allow global broadcast hotkeys for visible orphan sessions and centralize target resolution with coverage for workspace, global, and direct-target modes.
2026-09-05 01:06:36 +08:00
Meow-Emperor f9eded887f Fix global broadcast for orphan sessions
Keep stored boolean updates pure and propagate global broadcast state through terminal panes so orphan sessions can toggle and receive broadcasts correctly.
2026-09-05 00:11:52 +08:00
Meow-Emperor 701e35dac0 feat: 支持多标签直接启用广播模式
- 新增全局广播状态管理(globalBroadcastEnabled)
- 修改广播按钮显示逻辑:工作区内或孤立标签数 ≥2 时显示
- 修改广播输入处理:支持工作区广播和全局广播两种模式
- 工作区广播优先级高于全局广播,两种模式互不干扰
- 孤立标签(未加入工作区)可独立启用全局广播功能
2026-09-04 21:08:04 +08:00
netcatty-bot f66c098c9b fix: address Codex review on PR #3250 2026-09-02 09:59:49 +00:00
netcatty-bot 47667e80f5 fix: address Codex review on PR #3250 2026-09-02 09:36:22 +00:00
netcatty-bot a352ca3836 fix: address Codex review on PR #3250 2026-09-02 09:02:06 +00:00
netcatty-bot 1f52f6f399 fix(#3248): automated AI fix 2026-09-02 08:30:19 +00:00
Netcatty-Bot e8c291373b fix(terminal): add duplicate-session option that opens a fresh connection (#3222)
Add Duplicate Session as an explicit fresh-login alternative to Copy Tab. Keep authenticated transport reuse for Copy Tab and double-clicks, preserve fresh intent across session restoration, and avoid sending a previous target's directory command to a fresh bastion login.

Verified with focused and full tests, lint/build, independent local reviews, and real Electron menu operations against a local SSH server.

Fixes #3221.
2026-08-31 14:28:16 +08:00
bincxz e2ad0f526e fix(workspace): complete host drop paths 2026-08-12 11:44:35 +08:00
陈大猫 2c6390bf6f fix(tabs): restore previous tab after closing temporary session (#2804)
Closing the active tab fell back to last workspace/solo in array order,
so opening a temp tab then closing it jumped away from the prior work
tab (fixes #2788).

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
2026-08-07 10:25:57 +00:00
陈大猫 cc5ad3be16 perf: isolate Terminal hot props, cut memory/jank, and repay architecture debt (#2790)
* refactor: migrate architecture-debt hooks into application/state

Move SFTP Wave A stores/hooks and related vault/AI/terminal/systemManager
hooks out of components into application/state, update importers, and keep
thin deprecated re-exports at the old paths.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* refactor(sftp): align local bookmarks store API with global bookmarks

Export subscribe/get/set/rehydrate helpers from localSftpBookmarks to match
the globalSftpBookmarks external-store pattern.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix(electron): reduce baseline memory via spellcheck/GPU/prewarm guards

Disable spellcheck on BrowserWindows and the default session, drop spare
renderers, gate aggressive GPU switches behind NETCATTY_COMPAT_GPU, and make
settings prewarm opt-in via NETCATTY_PREWARM_SETTINGS.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* Isolate notes and customAccent from TerminalLayer hot props

Route vault notes through notesStore (shellHistoryStore pattern) and
app accent through appearanceChromeStore so note edits and accent-drag
ticks no longer rebuild TerminalLayer. Notes/AI slots and Terminal leaves
subscribe locally; VaultView and open-note callbacks stay unchanged.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix(ui): cut unnecessary AppView/VaultView/settings re-renders

Stabilize TopTabs close handler, memo AppHostTreeLayer, exclude accent from
settingsVersion, ignore connectionLogs off the logs section, share lastConnected
host refs, and keep rename dialog drafts local so chrome domain stays stable.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* chore: package size, dead code, and consolidation cleanup

Remove unused direct deps, exclude Vite-bundled renderer packages from
electron-builder, delete high-confidence dead code/no-op transfer warm
wiring, consolidate cloud provider IDs and KnownHost/SFTP helpers, and
land UI/AGENTS quick wins (rAF text batching, notes draft debounce,
streaming plain text, tempDirBridge, diagnostics adapter, External MCP
setters).

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: stabilize rAF text batching and diagnostics tests

Polyfill requestAnimationFrame for Node, flush pending text before
steer buffering, bypass rAF while steer is in flight, and stub
global localStorage for AI panel diagnostics adapter tests.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: correct import paths after application/state hook migrations

Migrated vault/AI/system hooks still used components/-relative imports;
point them at repo-root domain/components/types/lib instead.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: address Bugbot/Codex regressions from perf cleanup

- Keep blank Enter from closing RenameDraftDialog; only reset rename state after a non-empty submit
- Flush note drafts before vault mutations so pending title/body edits are not overwritten
- Re-apply appearanceChromeStore accent on appearanceTheme in Terminal, and keep layer themes unaccented

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix(notes): flush draft before markdown export paths

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: keep editor-close hotkey ref fresh during render

Assign handleRequestCloseEditorTabRef in render instead of useEffect so
Cmd/Ctrl+W never hits the App stub before the effect runs.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: keep accent in chrome themes without TerminalLayer thrash

Restore accent in globalAppearance for chrome/injection consumers.
Keep resolveFocusedAppearance identity stable across accent drag via
accent ref, while Terminal leaf still re-applies appearanceChromeStore.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: keep compose chrome accent live and merge note renames

Subscribe theme-panel focusedAppearance to appearanceChromeStore so
compose-bar chrome updates during color-picker drag even when
resolveFocusedAppearance identity stays stable. Tree renames now merge
title into the post-flush note instead of replacing from a stale row.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: clear terminal accent when switching back to theme mode

Re-resolve appearanceTheme by catalog id before applyCustomAccent so a
stale baked custom cursor/selection cannot stick after accentMode returns
to theme while TerminalLayer memo ignores accent props.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: register unsaved prompt singleton during render

AppView close handlers call promptUnsavedChanges outside the old
render-prop. Assign the singleton during render so Cmd/Ctrl+W and tab
close never hit the pre-effect null window that auto-cancels.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: keep vault import hooks UI-free and flush notes on teardown

Move ImportOptions into application/state and inject a notifier so
useVaultImportHandlers no longer imports components. Notes drafts also
flush on pagehide/beforeunload when Electron tears down without React
unmount.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: move AI terminal session context builders into domain

buildAITerminalSessionInfo and AIPanelContext now live under domain/ so
application hooks no longer import TerminalLayerSupport and create a
UI → application → UI cycle.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: drop duplicate AIPanelContext type from TerminalLayerSupport

The type is re-exported from domain; the local definition conflicted.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: keep migrated state hooks free of UI-layer imports

Move aiChatStreamingSupport into infrastructure/ai and poll list helpers
into domain/systemManager so useAIChatStreaming / useSystemManager no
longer import from components. Leave thin re-exports at the old paths.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: move remaining migrated-hook deps out of components

Host-key verification types/helpers now live in domain/, and SFTP column
layout types live in application/state/sftp/columnLayout. Application
hooks no longer import those definitions from the UI layer.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix: clear lint blockers and flush notes when panels hide

Move AI panel diagnostics persistence into application/state so
components stop importing localStorageAdapter. Flush note drafts when
retained NotesManager mounts become inactive, and silence related lint
warnings in theme/host-key helpers.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

* fix(notes): publish notesStore sync on vault note updates

updateNotes/updateNoteGroups now publishNotesSnapshot immediately so
AI/notes consumers do not briefly read a stale catalog after a hide
flush. Flush inactive drafts in useLayoutEffect before paint.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
2026-08-07 14:40:38 +08:00
chin d136c52aef fix(tabs): flag explicitly-titled workspaces instead of a title-string sentinel
Codex P2: resolveWorkspaceTabLabel treated any workspace whose title equals
"Workspace" as an untouched default and replaced it with a host label — so a
workspace a user renamed to "Workspace" (or a snippet named "Workspace")
lost its chosen name.

Add an explicit Workspace.autoTitle flag. It is authoritative when present:
- set false on user rename, snippet-created, named "New Workspace", and any
  createWorkspaceFromTargets call given an explicit name;
- absent/true means the tab may derive a host label.
Legacy workspaces without the flag fall back to the old default-title string
check, so already-open default splits still get host labels and previously
renamed workspaces keep their names.

- domain/models/workspace.ts: add autoTitle field.
- domain/workspace.ts: thread autoTitle through createWorkspaceFromSessionIds.
- application/state/useSessionState.ts: mark rename / snippet / named
  creation paths as explicit; createWorkspaceFromTargets takes an optional
  name and only marks custom when one is given.
- domain/sessionTabTitle.ts: derive only when autoTitle (with legacy string
  fallback); tests for explicit "Workspace" name and explicit auto-title.
2026-08-01 19:11:26 +08:00
chin f11661bea0 feat(tabs): show host name on split-workspace tabs instead of "Workspace"
A tab holding a split workspace showed the generic default title
"Workspace", giving no hint which host it belonged to. Derive the tab
label from the workspace's focused session when the workspace still
carries the default title: a local shell reads as its host label
(e.g. "Localhost"), an SSH session as its configured host name. If the
workspace spans more than one distinct host, the focused host is shown
with a "+N" suffix. A user-renamed workspace keeps its custom title.

- domain/sessionTabTitle.ts: add DEFAULT_WORKSPACE_TITLE sentinel and
  resolveWorkspaceTabLabel(), reusing resolveSessionTabTitle so labels
  match what single-pane tabs already show.
- domain/workspace.ts, application/state/useSessionState.ts: reference the
  shared DEFAULT_WORKSPACE_TITLE constant for the default title.
- components/top-tabs/TopTabItems.tsx: render the derived label (with a
  title tooltip) instead of workspace.title.
- domain/sessionTabTitle.test.ts: cover rename, single/multi-host, empty.
2026-08-01 18:24:05 +08:00
bincxz 1a8f5be432 fix(app): prevent stale workspace chrome and restore patch corruption
Stop TerminalLayerWorkspaceSection from falling back to memoized ctx when
sidePanelLiveStore clears activeWorkspace (workspace → solo tab). Refuse
session-restore active-tab patches without a trusted in-memory full payload
so a connect+activate race cannot write stale disk sessions under a new
activeTabId; force full rebuild from live state instead.
2026-07-30 22:48:16 +08:00
bincxz 57af825706 perf(app): cut remaining top-tab switch jank on the renderer path
Stop AppView from re-subscribing to activeTabId so shell composition no
longer rebuilds on every top-tab click; move plugin keybindings and host
editor surface visibility into leaf subscribers. Patch session-restore
activeTabId without re-serializing every session on tab switches, defer
chrome theme CSS work with fingerprint short-circuit + rAF, let terminal
workspace chrome read active workspace from the live store, apply TopTabs
presentation per tab, and keep hibernate wake chunked/idle with leaner
focus scheduling.
2026-07-30 22:33:31 +08:00
bincxz 8e7161a643 fix(app): distinguish presentation tombstone snapshots and history titles
Encode null vs missing presentation fields for useSyncExternalStore, and
compare AI history list title chrome so renames refresh without stream thrash.
2026-07-30 21:29:36 +08:00
bincxz f4ecb6d1a1 perf(app): isolate App shell domains, TopTabs titles, AI contexts, Vault history
Split the main-window mega bag into domain-scoped AppView slices so Vault,
terminal, chrome, dialogs, and mounts only re-render when their slice identity
changes. Drive tab titles/coding-CLI icons through sessionPresentationStore
(store-only live updates + orphan map overlay), retain presentation-stable
sessions for domain memos, stabilize AI panel context Maps with structural
equal/retain, and keep shell history on shellHistoryStore so Vault host lists
ignore history-only churn.
2026-07-30 17:28:16 +08:00
bincxz adffc47b29 fix(workspace): make copied layout replay-safe 2026-07-30 10:50:03 +08:00
bincxz 34ee6a7ecb fix(terminal): bound inherited cwd probes 2026-07-30 10:43:48 +08:00
chin 7f4de7d77b docs+comment: clarify copy-tab connection-reuse + menu order from review
- Spec: copies inherit copySession's connection-reuse behavior (SSH reuse),
  not 'independent' — correct the inaccurate wording.
- Spec/plan: Copy Tab sits after Rename, matching the session-tab menu order.
- useSessionState: document the sessionIdMap-completeness precondition behind
  the buildCopiedWorkspace 'as string' casts.
2026-07-29 22:02:20 +08:00
chin 5fa8178dfa feat(session): add copyWorkspace action for multi-pane tabs 2026-07-29 21:14:02 +08:00
chin 0be7d8ee65 feat(session): add buildCopiedWorkspace pure helper 2026-07-29 21:04:16 +08:00
chin 5dd8f31ff4 fix(terminal): address second-round PR review (cwd inheritance)
- Local clones now inherit the live tracked cwd: expose getSessionRestoreCwd
  (the OSC 7 cwd map, which is never mirrored onto session.lastCwd) and feed it
  into captureInheritedCwd as the primary source, so Copy Tab / Split of a
  running local terminal open in its current dir, not the launch dir (P1)
- Gate the SSH /proc probe like the app's own cwd-probe path: never probe
  network devices (Huawei VRP etc. can drop the session on the extra exec
  channel) and consult the SSH banner for unclassified hosts (P1)
- Mark the inherited cd consumed only when it is actually sent (from the
  restore-cwd consumption callback), so a failed first connect can re-arm the
  intent on retry instead of starting in the login dir (P2)
2026-07-29 16:48:53 +08:00
chin 97f3a1ae77 fix(terminal): clear pendingInitialCwd once live cwd tracked (one-shot cd) 2026-07-29 15:23:49 +08:00
chin 123326b899 feat(terminal): thread inheritedCwd through copySession/splitSession 2026-07-29 14:52:09 +08:00
ryan-wong-coder 6468295dc1 fix(plugins): harden connection provider review paths 2026-07-26 00:39:28 +08:00
axe006 bb44fe6a6c feat(ai): 新增 MCP 会话静默运行开关
AI 通过 MCP host_open 打开会话时会新建标签并抢占当前焦点,打断用户
正在查看的其他标签。新增"AI 会话静默运行"开关(默认关闭),开启后
host_open 打开的会话不出现在标签栏、不被自动激活,在后台继续正常
运行,可通过 terminal_execute/sftp_*/session_close 等工具操作,
应用重启后也不会被恢复为标签。用户可通过托盘面板查看这些隐藏会话
(带 AI 徽标),外部 MCP 客户端的会话列表不受影响。

Closes #2340

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-21 10:50:21 +08:00
bincxz 0945361a23 feat(ai): restore saved outputs after restart 2026-07-17 14:54:35 +08:00
陈大猫 929456a231 fix(tabs): close session batches atomically (#2257)
Fixes #2256
2026-07-16 18:00:57 +08:00
bincxz 7059007bf4 fix preserve inherited serial backspace behavior 2026-07-15 13:23:16 +08:00
bincxz b399300dc7 fix snapshot legacy serial backspace default 2026-07-15 13:14:36 +08:00
陈大猫 09cd907b85 fix(terminal): restore workspace pane X to standalone tab (#2106)
Workspace toolbar X was calling closeSession and destroying the pane
instead of returning it as its own tab. Route that control through
detach when available, harden close/detach against stale session state,
and record the workspace id in tabOrder when drag-to-split creates a
workspace so later detach can put tabs back correctly.
2026-07-11 02:21:13 +08:00
bincxz b688fc815b fix(terminal): seed Local Terminal autocomplete from shell histfiles
Local Terminal used a per-session hostId, so autocomplete history never
accumulated, and the store never imported ~/.zsh_history. Stabilize the
hostId and seed from local histfiles so prefix suggestions match Ghostty.

Closes #2037

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 11:16:41 +08:00
bincxz f3ac99e587 Address terminal UI review findings 2026-07-02 01:13:38 +08:00
bincxz fe7a867f38 Improve terminal tab switching stability 2026-07-02 01:00:32 +08:00
bincxz 0b94a82579 Fix multiline snippet execution modes 2026-06-30 17:01:27 +08:00
陈大猫 6b9b71ac8a feat(scripts): terminal script automation, recording, and side panel (#1763)
* feat(scripts): add terminal script automation, recording, and side panel

Introduce nct script runtime in the main process with terminal-side recording,
execution overlay, Monaco editor, connect-script queues, and scripts side panel
integration. Fix recording to wire scriptRecorderRef into xterm, use waitForPrompt
for root/user shells, and save recorded scripts through the global editor dialog.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): address Bugbot review findings for recording and side panel

Refresh script run state in side panel memo, guard toolbar recording against
multi-session conflicts, reset connect scripts on reconnect, resolve focused
session via getActiveTerminalSessionId, and avoid wiping host edit form when
snippets list updates.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): prevent pending script re-run and improve workspace run feedback

Track one-shot pendingScript execution separately from onConnect queue so
reconnects do not replay Run-now scripts. Fall back to focused session when
running on all tabs outside a workspace, and toast when every tab is still
connecting.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): consume connect-script window once and filter serial hosts

Mark the onConnect script evaluation as consumed even when the queue is
empty so later snippet/host edits do not rerun automation mid-session.
Restore serial-host filtering in SelectHostPanel confirm handler.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): grace period before giving up on connect-script queue

Only mark onConnect automation as consumed after scripts run or a short
post-connect grace window expires, so late-loading snippets still trigger
while mid-session Vault edits do not.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): gate connect-script consumption on vault hydration

Replace the grace timer with vault-init and unresolved host script binding
checks so late-loading snippets still run onConnect automation while
mid-session edits stay suppressed. Clear pending script run state on
disconnect so reconnect retries workspace pending scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): honor run targets and retry failed connect automation

Route QuickScriptEditorDialog Run through onRunSnippet for multi-host
workspaces. Defer connect/pending script completion markers until each
script succeeds and retry the queue after failures.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): stabilize pending runs and global connect queue sync

Keep pending script run state across reconnects, run onConnect scripts
before one-shot workspace pending scripts, and strip per-host queue entries
when an onConnect script targets all hosts.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): defer host queue snippet sync and guard connect runs

Persist snippet target links only when the host panel is saved, block
duplicate connect-script scheduling while a batch is running, and require
runnable hosts before showing Run in the snippets editor footer.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): retry connect failures and surface output-trigger errors

Use a retry tick in connect-script effect deps, toast automation failures
from output triggers, and require runnable hosts before QuickScript Run.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): track id-less pending runs and re-arm output triggers

Remember anonymous pendingScript objects after first run and allow
onOutput triggers to fire again when new terminal output arrives.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): unblock paused connect runs and pass session meta

Resolve waitForScriptRun on pause, run workspace scripts per session
with hostname context, defer output-trigger arming until runs start, and
add noRunnableHosts i18n for QuickScript Run.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): serialize output triggers and defer empty connect finalize

Fire at most one onOutput trigger per scan while a run is active, and
only finalize an empty connect queue after vault snippets are loaded.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): guard output launch race and script run waits

Block overlapping onOutput launches, timeout stuck waitForScriptRun
promises, and disable vault Run when no connectable targets exist.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): match output triggers on new chunks only

Scan onOutput patterns against recent terminal output instead of buffer
length dedupe, and restore overflow-visible on SelectHostPanel new-host flow.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): await sequential workspace runs and output launch

Wait for each tab script to finish in sequential workspace mode, and hold
output-trigger launch guard until the session run becomes active.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): wait through pause and hold output trigger until done

Keep connect and sequential workspace queues blocked until scripts
complete or fail, and retain output-trigger guard until the launched run
finishes.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): harden output trigger wait helpers

Add explicit timeouts to output-trigger wait helpers and stop rescanning
the buffer after script completion to avoid sticky-match rerun loops.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): allow empty connect queue and match output in new chunks

Treat an empty connectScriptIds array as an explicit cleared queue instead
of re-migrating from snippet targets, and only fire onOutput triggers when
the latest terminal output contains the pattern.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): require fresh output overlap for onOutput triggers

Only fire output-matched scripts when the regex match extends into the
latest terminal chunk, preventing reruns from stale buffer text.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): promote manual scripts added to host connect queue

Diff connect queue changes from raw connectScriptIds so saving a host
updates manual scripts to onConnect when they are newly queued.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): dedupe output triggers by match position

Track the buffer end offset of each output trigger match and ignore
stale re-scans, with a longer wait for run registration before retry.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): record output trigger matches only after run starts

Propagate automation launch failures to output triggers and commit match
dedupe only once the session run is registered as active.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): address Codex review on wait cursor and sensitive codegen

Track scan offset so waitFor/waitForAny only match output after the previous wait, and emit sendLine after sensitive prompt in recorded scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(scripts): harden onOutput triggers against PTY echo and local input

Filter server output before pattern matching so onOutput fires only after
Enter on real stdout, not on keystroke/paste echo, OSC/SGR sequences, or
alternate-screen apps. Add dev diagnostics and scope triggers to the active
session when no explicit host targets are configured.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(scripts): remove onOutput trigger debug logging

Drop temporary diagnostics module and console traces now that PTY echo
filtering is verified; keep the production trigger pipeline unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 23:48:12 +08:00
陈大猫 bd3491a3e4 revert(terminal): remove auto-run snippet stty protection (#1594) (#1599)
* fix(terminal): narrow snippet terminal restore to RHEL-family hosts

Limit auto-run snippet stty protection to distros affected by #1498 and
suppress wrapper echo so Ubuntu, Rocky, and macOS users see their raw
commands again.

Fixes #1594

Co-authored-by: Cursor <cursoragent@cursor.com>

* revert(terminal): remove auto-run snippet stty protection (#1594)

The wrapper added in #1498 caused visible preamble noise for all snippet
executions. Revert to inserting the original command directly; the underlying
CentOS 7 terminal issue reproduces when running the script manually too.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 20:25:16 +08:00
bincxz 4b874410f9 fix(opencode): harden SDK streaming, model list, and Windows shim path
Route Netcatty context through body.system, filter echoed user parts,
keep OpenCode env/shim alive for server lifetime, and cap model preset dropdown height.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 18:56:46 +08:00
陈大猫 c6bdcffb89 feat: dynamic terminal tab titles (fixes #1572) (#1576)
* feat: add dynamic terminal tab titles for shell-reported session names

Follow OSC 0/2 window titles on session tabs so tools like Claude Code can show live session state, with a per-host opt-out to keep connection names instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: address dynamic tab title review findings

Restore the missing cn import, clear dynamic titles when the shell sends an empty OSC title, and drop stored dynamic titles when a host disables the feature.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: preserve renamed session labels and align focus sidebar titles

Prefer user-assigned customName over shell titles, skip no-op dynamic title updates, and use resolveSessionTabTitle in the workspace focus sidebar.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat: show coding agent icons on session tabs

Detect Claude Code, Codex, OpenCode, Droid, and other CLIs from OSC titles and launch commands, reusing shared agent icon assets inspired by freshell pane icons.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: harden coding CLI detection across SSH and startup paths

Wire output scanning through attachSessionToTerminal, seed providers from
auto startup commands, prevent title signals from overriding command
detection, clear sticky state on shell titles, and release output scanners
on session close.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: reset CLI output scanner when provider state clears

Prevent exited-agent banners from immediately re-sticking the tab icon
after the shell title returns to a normal shell name.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: update sticky CLI provider when title signals a different agent

Allow agent switches in the same terminal while still resetting the output
scanner whenever the provider identity changes.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: avoid clearing CLI provider on blank titles and cap output scan

Ignore transient empty OSC titles and stop banner scanning after 16KB of
unmatched output so regular SSH sessions do not pay perpetual scan cost.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: prefer runtime CLI provider over host startup command on tabs

Runtime detection from commands, output, and titles should win over static
host startup commands when resolving the session tab icon.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: satisfy eslint for terminal escape stripping regexes

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 14:20:05 +08:00
bincxz affe197f26 Improve Netcatty responsiveness 2026-06-23 01:26:12 +08:00
bincxz a238a5ac2f Restore terminal mode after auto-run snippets 2026-06-22 14:10:50 +08:00
Zheng Liu 9674cd8ae6 fix: protect peer restore windows 2026-06-18 11:39:18 +08:00
Zheng Liu ba9d9c1e58 fix: isolate session restore side effects 2026-06-18 11:04:41 +08:00
Zheng Liu 73e615cb64 fix: isolate restored peer session windows 2026-06-18 10:52:15 +08:00
Zheng Liu 93079bb576 fix: prevent session restore snapshot loss 2026-06-17 23:41:29 +08:00
Zheng Liu 04906a80ff fix: tighten session restore edge cases 2026-06-17 22:39:10 +08:00
Zheng Liu 193b2b73c9 fix: harden session restore reconnect and sanitization 2026-06-17 22:07:32 +08:00