Add clipboard image paste support#3
Merged
Conversation
Detect images on the clipboard when pasting (Ctrl+V / Cmd+V or right-click), save as PNG to a temp directory, and insert the file path into the terminal. This enables sharing screenshots with AI tools like Claude Code directly. Also fixes paste shortcut on macOS by checking both ctrlKey and metaKey. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
InbarR
pushed a commit
that referenced
this pull request
Apr 28, 2026
Two independent bugs in this area combined to produce the user-visible
"sidebar highlights the wrong session" report. Both are fixed and
covered by Playwright regressions in tests/e2e/session-sidebar-highlight.
1. Sticky auto-link binding (terminal-store.ts:2380)
updateTerminalTitleFromSession refused to bind any terminal whose
aiSessionId was already set ("if (t.aiSessionId) continue;"). Once a
pane was linked, that link was permanent - even when the user closed
the original AI process and started a fresh one in the same pane.
The auto-highlight then faithfully showed the now-superseded session.
Fix: allow the focused pane to rebind when it already has a (now
stale) link and the new session's cwd matches. Non-focused panes with
an existing link remain off-limits so a background pane never
silently has its session moved.
2. Auto-highlight target hidden by group collapse (CopilotPanel.tsx:336)
When groupByRepo is on (default) and #69's auto-collapse fires on
initial mount, every group is collapsed. setSelectedIndex picks the
right idx in displayList, but the matching .ai-session-item is gated
behind {!isCollapsed && ...} and never renders - so the .selected
class lands on no DOM node, and whichever row was selected before
(commonly the pinned tmax session at idx 0) appears to stay
highlighted.
Fix: when the auto-highlight effect resolves the focused pane's
session, also remove that session's group key from collapsedGroups
so its row actually renders. Doesn't affect any other groups.
Tests (tests/e2e/session-sidebar-highlight.spec.ts):
- auto-link rebinds focused pane on supersession (AC #3)
- auto-link safety net: non-focused pane keeps its binding
- visual highlight follows focus when groupByRepo is off (AC #2)
- visual highlight expands the focused session's group when collapsed
(the user's actual symptom)
Verified 7 adjacent AI-session tests still green
(issue-69-group-by-repo, pin-sessions-persist, jump-to-prompt x4,
pane-menu-show-prompts).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
InbarR
pushed a commit
that referenced
this pull request
May 24, 2026
When the Copilot CLI changes directory internally (via cwd command), the diff panel failed with 'No git repository found from: C:\Users' because terminal.cwd (shell CWD) stays stale — the CLI doesn't emit OSC sequences. Instead of overwriting terminal.cwd (which causes ping-pong, WSL path corruption, and session restore poisoning), the diff panel's CWD selector now checks the linked AI session's CWD first, falling back to shell CWD when no session is linked. Closes #3 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
InbarR
pushed a commit
that referenced
this pull request
May 24, 2026
Follow-up to #3 (diff panel CWD resolution). Two improvements based on adversarial review feedback: 1. Stale session guard: getEffectiveCwd() only prefers AI session CWD when the session is active (status !== 'idle'). After CLI exit, the session goes idle and the helper falls back to shell CWD — preventing the diff panel from showing the wrong repo. 2. Centralized helper: findSessionById() and getEffectiveCwd() are exported from terminal-store.ts. This eliminates the hardcoded copilotSessions.find() ?? claudeCodeSessions.find() pattern and makes adding a third provider a single-point change. DiffReview.tsx now uses getEffectiveCwd() instead of inline logic. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
os.tmpdir()/tmax-clipboard/), and insert the file path into the terminalctrlKeyandmetaKeyin all paste handlers (main window, detached window, and right-click)Changed files
src/shared/ipc-channels.tsCLIPBOARD_SAVE_IMAGEIPC channelsrc/main/main.tssrc/preload/preload.tsclipboardHasImage()(sync) andclipboardSaveImage()(async) APIssrc/renderer/components/TerminalPanel.tsxsrc/renderer/DetachedApp.tsxCHANGELOG.mdTest plan
npm start→ screenshot to clipboard → Ctrl+V → temp file path appears in terminal🤖 Generated with Claude Code