* fix(terminal): support Windows shell selection for SSH hosts
* fix(runtime): register SSH Windows capability preflight RPC
* fix(terminal): honor remote Git Bash and split preflight IPC seams
* fix(terminal): keep SSH Windows shell state tied to the selected host
* fix(terminal): preserve Windows SSH shell selection
---------
Co-authored-by: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com>
* Redesign the search button in the sidebar to look like a standard input field with a border, background, and absolute icon positioning.
* Replace the basic `<kbd>` label with `ShortcutKeyCombo` elements driven by `useShortcutKeyComboDetails`.
* Show the shortcut combinations when the search container is focused as well as hovered.
Follow-up to #6644. The merged fix used a single post-spawn
requestAnimationFrame, which did not fully close the first-mount column
race: the pane's real layout can keep changing for several frames (split
equalize, sidebar/title reflow), so a one-shot re-fit could still measure a
stale width and leave the PTY pinned. The golden 'during initial mount' e2e
test failed ~1 in 9 runs with the single-frame version.
Poll for up to 12 frames, forwarding the settled size to the PTY only when
it differs from what the PTY was last told (mirroring the existing
ResizeObserver stability loop). Each resize is gated on an actual change, so
a TUI sees at most a couple of SIGWINCH during startup, not a loop.
Verified: golden test passes 6/6 with repeat-each + retries; full spec
15/15. Without this change the single-frame version is intermittently flaky.
Co-authored-by: Orca <help@stably.ai>
* Stop PermissionRequest/blocked/waiting hook states from firing agent-task-complete
'waiting' (e.g. a Claude PermissionRequest) and 'blocked' (e.g. a Copilot
elicitation dialog) occur mid-turn while the agent is still alive, yet
isCompletionHookState treated them as completion and dispatched a false
agent-task-complete. Restrict completion to a genuine 'done' and add an
isAttentionHookState early return that also cancels a pending done-quiet
timer when an attention pause arrives first. The 'needs you' notification
for these states is raised separately (smart-attention), so it is unaffected.
Fixes#5698
* Preserve attention notifications for waiting hooks
---------
Co-authored-by: brennanb2025 <brennanb2025@users.noreply.github.com>
Co-authored-by: Neil <neil@stably.ai>
* Support dictation and image attachments in live terminal input mode
- Unify image attachment and voice dictation actions across both live
and buffered terminal input views using a shared action bar.
- Route completed dictations directly to the active PTY (matching
live keystroke semantics) when live mode is active, or append
them to the input field in buffered mode.
- Add live terminal status headers to indicate mic activity and
image upload progress.
- Include unit tests for the dictation routing logic.
* rm unused file
Opening a workspace whose worktree lives on a \wsl.localhost\<distro>
UNC path failed with 'Working directory ... does not exist' even though it
exists. validateWorkingDirectory relied on Win32 fs.statSync, which is
unreliable against the WSL 9P share and can report ENOENT for directories
that exist on the Linux side.
Make working-directory validation WSL-aware: when the cwd is a WSL UNC path,
ask the distro itself via 'wsl.exe -d <distro> -- test -d <linuxPath>' and only
fall back to the fs check when wsl.exe is inconclusive. Native Windows path
validation is unchanged.
Fixes#6331
Co-authored-by: brennanb2025 <brennanb2025@users.noreply.github.com>
On Windows the bundled orca.cmd runs Orca.exe with the unpacked CLI
entrypoint and ELECTRON_RUN_AS_NODE=1. When that env var is dropped, Orca
boots as a GUI, loses the single-instance lock to an already-running
window, and exits silently with no stdout.
Add a packaged-CLI-entry redirect that detects a Windows launch whose argv
carries the known in-package CLI entrypoint and re-runs it in Electron node
mode before the single-instance lock gate can bounce it, then exits with the
CLI's status. Mirrors the existing maybeRedirectAppImageCliLaunch pattern.
Fixes#5774
Co-authored-by: brennanb2025 <brennanb2025@users.noreply.github.com>
* feat(mobile): add commit failure recovery panel with AI fix action
- Surfaces a "Commit failed" panel with a one-tap AI fix button when a
git commit fails in the source control view or PR creation flow
- Detects commit failures specifically during the committing progress
step and captures staged entries and commit message for context
- Extracts commit failure summary and prompt logic into
`src/shared/source-control-commit-failure.ts` and PR checks prompt
into `src/shared/pr-checks-fix-prompt.ts` so both desktop and mobile
share the same implementations
- Adds auto-find of an available Metro port starting from 8081 and
extracts expo CLI bootstrap into `mobile-expo-cli.mjs` shared by
`start-emulator` and a new `start-expo.mjs` wrapper
* Share source-control AI prompts and simplify mobile PR actions
- Extract conflict, check-fixing, and commit-failure prompt builders
to shared modules for reuse by both desktop and mobile.
- Configure Metro in the mobile package to watch and bundle modules
from the repository-root shared directory.
- Remove the desktop-style merge method picker from the mobile PR
actions panel, opting to use repository defaults automatically.
- Refactor mobile hosted review creation and git preparation logic
into dedicated helper files.
* Preserve terminal scrollback when restoring a hidden alternate-screen pane
On Windows, an alternate-screen TUI pane (Claude Code) could lose scroll-up
after being hidden (tab/worktree switch or app backgrounded) and shown again.
Root cause: on hidden->visible restore, applyMainBufferSnapshot
unconditionally wrote a destructive clear (\x1b[2J\x1b[3J\x1b[H) before
replaying the snapshot, wiping xterm's scrollback. The attach/reattach path
already guards this same clear behind !isAlternateScreen (pty-transport.ts);
the snapshot path did not.
Thread an alternateScreen flag from the backend headless serialization
through the pty:getMainBufferSnapshot IPC + preload types into
applyMainBufferSnapshot, and skip the destructive clear when restoring an
alternate-screen buffer. Add a regression test asserting the clear is NOT
emitted for an alt-screen restore (and the existing normal-buffer test still
asserts it IS).
Fixes#5723
* test: account for alternateScreen flag in empty headless snapshot assertions
The alt-screen scrollback fix threads an alternateScreen flag through the
headless snapshot return type. Two sibling empty-buffer tests used exact
toEqual() assertions that did not include the new (legitimately false) key.
Update them to reflect the correct snapshot shape.
---------
Co-authored-by: brennanb2025 <brennanb2025@users.noreply.github.com>
Extract Annotations and Jobs sections into dedicated components, add
clickable annotation locations that open files at a line, and bucket job
steps with collapsible passing/skipped summaries.
Co-authored-by: Orca <help@stably.ai>
Claude Code echoes prompt keystrokes by redrawing the input line in
place (CR + CHA + reprint + erase-line) WITHOUT DEC 2026 synchronized
output, split across ConPTY chunks. On native Windows ConPTY the xterm
buffer ends up correct, but its DOM renderer paints these rapid rewrites
one frame late, leaving a phantom first char or an overwritten cell
("zzzx" rendered as "zzx") until a window resize forces a repaint.
The existing foreground render-settle forces a single synchronous
refresh for in-place rewrites, but that races the late DOM paint. Only
the DEC 2026 cursor-restore and viewport-scroll cases scheduled a
follow-up next-frame repaint. Extend that follow-up to the native
Windows in-place rewrite pattern so the column desync self-corrects
without the user jiggling the window. Scoped to native Windows ConPTY
foreground in-place rewrites, so plain shells, SSH/remote panes, and
non-Windows renderers are unaffected.
Fixes#5656Fixes#5653
Co-authored-by: brennanb2025 <brennanb2025@users.noreply.github.com>
* Resolve PowerShell to a real executable so terminals spawn (Windows error code 5)
On Windows, launching a PowerShell terminal could fail with:
Failed to spawn shell "pwsh.exe": Cannot create process, error code: 5
error code 5 = ERROR_ACCESS_DENIED from CreateProcessW inside node-pty's
ConPTY. Orca handed ConPTY a bare family name ("pwsh.exe" /
"powershell.exe"). When pwsh resolved to the Microsoft Store App Execution
Alias stub under WindowsApps (or was blocked by AV/AppLocker/SAC),
CreateProcessW rejected it with access-denied. isPwshAvailable probes via
execFileSync (which DOES follow the alias), so detection and launch disagreed.
Fix: resolve the PowerShell executable to a real absolute path before
spawning, skipping the WindowsApps alias stub, and add a Windows fallback
chain: pwsh (resolved abs) -> Windows PowerShell (System32 abs) -> cmd.exe.
SSH/remote and WSL/Git Bash/cmd paths are unaffected.
Fixes#5161
* test(pty): assert resolved absolute PowerShell path in win32 spawn tests
The PowerShell-resolution fix (#5161) now hands ConPTY a real absolute
executable instead of a bare 'powershell.exe'/'pwsh.exe' family name. The
pre-existing win32 spawn assertions in pty.test.ts (not in the worker's
per-file affected set) still expected the bare names and went red on the
full CI verify suite. Mock the fs seam and pin the install roots the
resolver probes so the resolved path is deterministic on Linux CI and
Windows alike, and assert the resolved System32 / Program Files paths.
* fix(pty): derive Windows shell name with win32 basename for determinism
getForegroundProcess() falls back to the spawned shell's basename when
Windows node-pty reports only the terminal name. The basename was taken
with the host-native path.basename, so on a non-Windows host (Linux CI)
the Windows absolute path 'C:\...\powershell.exe' was not split and the
whole path was stored as the shell name — making getForegroundProcess
return the absolute path instead of 'powershell.exe'. This produced a
host-dependent result for the same forced win32 platform.
Parse the spawned shell basename for the target platform (win32 basename
on Windows, POSIX otherwise), matching the daemon path
(pty-subprocess.ts already uses pathWin32.basename). The win32 spawn
foreground test is now deterministic on Linux CI and Windows alike.
---------
Co-authored-by: brennanb2025 <brennanb2025@users.noreply.github.com>
The Windows ICO was rasterized straight from the untrimmed 1024px macOS
render, inheriting Icon Composer's transparent safe-area inset (glyph only
~83% of the canvas). Windows scales the largest ICO frame down for the
taskbar/"Open with" list without compensating, so the icon looked visibly
small next to native apps.
Add config/scripts/trim-windows-icon-source.mjs (pngjs-based): trims the
transparent inset, re-squares with a small 2% margin, and emits a filled
multi-size ICO (~96% fill). Regenerate resources/build/icon.ico from it and
update generate.sh to delegate to the script so the committed binary stays
in sync regardless of whether ImageMagick is installed.
Fixes#5357
Co-authored-by: brennanb2025 <brennanb2025@users.noreply.github.com>
* feat(terminal): add "Copy Context" to the terminal context menu
Copying an agent session's captured context required opening the Fork
Agent Session dialog and clicking its "Copy context" button — two steps
for something you often just want on its own (e.g. to paste elsewhere).
Add a "Copy Context" item to the terminal right-click menu, right under
"Fork Agent Session…". It reuses the existing capture + clipboard path
(prepareAgentSessionForkFromPane → copyAgentSessionForkContext), so the
copied text is identical to the dialog's, just one click away and without
opening the dialog.
Fixes#5020
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(terminal): copy plain context, not the fork prompt
Copy Context now copies the bounded, cleaned transcript on its own with a
neutral 'Context copied' toast, instead of reusing the fork prompt (with its
'this is a fork… acknowledge and wait' framing) and the fork-copy toast. That
framing is noise when pasting into another tool, which is the issue's use case.
Extracts buildBoundedSessionTranscript() from the fork-prompt builder and adds
copyAgentSessionContextFromPane(); the fork dialog's own copy button is
unchanged.
Co-authored-by: Orca <help@stably.ai>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
Co-authored-by: Orca <help@stably.ai>
Monaco's context-menu Paste reads navigator.clipboard.readText(), which is blocked in Orca's sandboxed renderer, so right-click Paste did nothing while Cmd/Ctrl+V and right-click Copy worked.
Register a higher-priority implementation on Monaco's PasteAction that reads the clipboard through Orca's trusted IPC bridge (window.api.ui.readClipboardText) and dispatches Monaco's native paste. Falls through for read-only/unfocused/non-editor targets so Cmd/Ctrl+V is untouched, and routes oversized pastes through the existing chunked inserter to preserve the too-large guard for both paste paths.
Verified with unit tests (incl. read-only fall-through, empty/too-large/focus-lost/oversized) and end-to-end in the Electron app.
Fixes#6274.
Non-Latin layouts (Cyrillic, Greek, ABNT2, …) report a non-Latin logical `event.key` for physical letter keys (physical `KeyC` → `с`) while `event.code` stays `KeyC`. The shortcut matcher only fell back to the physical code when `event.key` was empty/Dead/Unidentified, so Mod+letter/digit chords never matched on those layouts — Ctrl+C copy in Monaco Source mode appeared to do nothing and the chord could not even be rebound in Settings.
Adds a tightly-gated non-Latin physical-code fallback (non-macOS, real Ctrl/Meta modifier held, excludes AltGr/Ctrl+Alt composition, only when no logical Latin token exists). Verified: full keybindings suite (55 tests) + targeted Cyrillic/Greek/AltGr/wrong-key cases pass; web + node typecheck clean.
* fix(source-control): refresh branch compare after upstream changes
- Refresh branch compare when upstream status changes for the same worktree and base ref
- Prevent stale Create PR eligibility from remaining clickable while a newer preflight is loading
- Add regression coverage for upstream-driven compare refreshes and stale Create PR loading precedence
* fix(source-control): preserve review provider during preflight refresh
---------
Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
* Implement automated git preparation workflow for mobile PR creation
Introduce a structured hosted review intent preparation workflow to handle
staging, AI commit message generation, committing, and pushing changes
automatically before displaying the pull request composer on mobile.
- Map creation block reasons to descriptive user-facing validation errors
(e.g., dirty working tree, default branch, detached head) to match desktop.
- Decouple hosted-review business logic into a dedicated service helper.
- Update source control runner hooks to handle the new preparation flow.
* Refactor mobile PR creation to run intent and open URL directly
Remove MobilePrComposeSheet and the local compose form, moving instead
to a direct PR creation workflow that matches the desktop experience.
- Add runMobileHostedReviewCreateIntent to handle the full prepare,
push, and create sequence.
- Replace useMobileOpenPrSheetRunner with useMobileCreatePrRunner to
trigger the creation workflow and directly open the created PR URL.
- Simplify state management by removing showPrSheet, prPrefill, and
associated local compose sheets.
* Propagate git status and commit state on PR creation failure
Update `MobileHostedReviewCreateIntentOutcome` and the local change
commit helper to include optional `committed` and `status` fields in
their failure results.
This ensures that if PR preparation fails, callers still receive the
current repository status and know if their local changes have already
been committed.
* Add tests for mobile hosted review creation flow
Introduce unit tests for runMobileHostedReviewCreateIntent to verify
different scenarios of creating a hosted review on mobile, including:
- Successful flow including staging, committing, pushing, and creating
- Eligibility block handling (e.g., authentication requirements)
- Error reporting when creation fails after an automatic commit
* Block mobile PR creation on unresolved conflicts and refresh status
Prevent creating a hosted review on mobile when there are unresolved
merge conflicts. Also, return the latest git status on failures and
reload it in the UI to keep the source control screen in sync.
* Prefer fetched PR head SHA over cached status SHA for PR checks
On mobile, a create command can commit before opening the review,
meaning the fetched PR's head SHA is fresher than the route's cached
status SHA. Prioritizing the fetched PR head SHA ensures we fetch checks
for the most up-to-date commit.
* Fix mobile PR creation errors and validate branch presence
- Reject branch matches when the status branch is null or missing to
prevent PR creation when the branch is lost.
- Display actual PR creation errors in the sidebar instead of silently
ignoring them on failure.
- Trim leading and trailing whitespace from the base branch reference
before persisting the worktree link.
* Improve mobile emulator pairing startup