Skip to content
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
43879d3
fix: don't clear selection when OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON…
ariane-emory Jan 27, 2026
681f480
feat: add cmd+c keybinding for copying selected text
ariane-emory Jan 27, 2026
dbb1995
fix: allow ctrl+c to copy selection when text is selected
ariane-emory Jan 27, 2026
ecb061d
fix: disable mouse tracking when OPENCODE_EXPERIMENTAL_DISABLE_COPY_O…
ariane-emory Jan 27, 2026
5f07b7e
fix: explicitly disable mouse tracking when OPENCODE_EXPERIMENTAL_DIS…
ariane-emory Jan 27, 2026
8f1ef79
fix: remove ctrl+c copy keybinding, retain standard macOS exit behavior
ariane-emory Jan 27, 2026
df0c267
fix: platform-specific ctrl+c behavior - copy on Windows/Linux, exit …
ariane-emory Jan 27, 2026
0f88500
fix: don't intercept ctrl+c when flag is set on Linux/Windows
ariane-emory Jan 27, 2026
48c375f
Merge branch 'dev' into fix/repair-disable-copy-on-select
ariane-emory Jan 29, 2026
6560adc
Merge branch 'dev' into fix/repair-disable-copy-on-select
ariane-emory Jan 29, 2026
0a22e51
Merge dev into fix/repair-disable-copy-on-select
ariane-emory Jan 30, 2026
0e2c9dd
Merge branch 'dev' into fix/repair-disable-copy-on-select
ariane-emory Feb 1, 2026
0172de6
Merge branch 'dev' into fix/repair-disable-copy-on-select
ariane-emory Feb 2, 2026
17b1267
Merge dev into fix/repair-disable-copy-on-select
ariane-emory Feb 3, 2026
3a02075
Merge branch 'dev' into fix/repair-disable-copy-on-select
ariane-emory Feb 4, 2026
ddcd6e0
Merge branch 'dev' into fix/repair-disable-copy-on-select
ariane-emory Feb 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 29 additions & 15 deletions packages/opencode/src/cli/cmd/tui/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,15 @@ export function tui(input: {
targetFps: 60,
gatherStats: false,
exitOnCtrlC: false,
useMouse: !Flag.OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT,
useKittyKeyboard: {},
autoFocus: false,
consoleOptions: {
keyBindings: [{ name: "y", ctrl: true, action: "copy-selection" }],
keyBindings: [
{ name: "y", ctrl: true, action: "copy-selection" },
{ name: "c", ctrl: true, action: "copy-selection" },
{ name: "c", meta: true, action: "copy-selection" },
],
onCopySelection: (text) => {
Clipboard.copy(text).catch((error) => {
console.error(`Failed to copy console selection to clipboard: ${error}`)
Expand Down Expand Up @@ -665,19 +670,19 @@ function App() {
width={dimensions().width}
height={dimensions().height}
backgroundColor={theme.background}
onMouseUp={async () => {
if (Flag.OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT) {
renderer.clearSelection()
return
}
const text = renderer.getSelection()?.getSelectedText()
if (text && text.length > 0) {
await Clipboard.copy(text)
.then(() => toast.show({ message: "Copied to clipboard", variant: "info" }))
.catch(toast.error)
renderer.clearSelection()
}
}}
onMouseUp={
!Flag.OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT
? async () => {
const text = renderer.getSelection()?.getSelectedText()
if (text && text.length > 0) {
await Clipboard.copy(text)
.then(() => toast.show({ message: "Copied to clipboard", variant: "info" }))
.catch(toast.error)
renderer.clearSelection()
}
}
: undefined
}
>
<Switch>
<Match when={route.data.type === "home"}>
Expand Down Expand Up @@ -708,7 +713,16 @@ function ErrorComponent(props: {

useKeyboard((evt) => {
if (evt.ctrl && evt.name === "c") {
handleExit()
if (process.platform === "darwin") {
handleExit()
return
}
if (Flag.OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT) {
return
}
if (!renderer.getSelection()?.getSelectedText()) {
handleExit()
}
}
})
const [copied, setCopied] = createSignal(false)
Expand Down