Skip to content

Commit 36c3e7d

Browse files
Merge branch 'dev' into dev
2 parents 96a8805 + 573ffe1 commit 36c3e7d

8 files changed

Lines changed: 41 additions & 26 deletions

File tree

STATS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,4 @@
128128
| 2025-10-31 | 626,612 (+8,766) | 564,579 (+9,553) | 1,191,191 (+18,319) |
129129
| 2025-11-01 | 636,100 (+9,488) | 581,806 (+17,227) | 1,217,906 (+26,715) |
130130
| 2025-11-02 | 644,067 (+7,967) | 590,004 (+8,198) | 1,234,071 (+16,165) |
131-
| 2025-11-03 | 653,190 (+9,123) | 597,139 (+7,135) | 1,250,329 (+16,258) |
131+
| 2025-11-03 | 653,130 (+9,063) | 597,139 (+7,135) | 1,250,269 (+16,198) |

bun.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ try {
152152
return session.id.slice(-8)
153153
})()
154154
console.log("opencode session", session.id)
155+
if (shareId) {
156+
console.log("Share link:", `${useShareUrl()}/s/${shareId}`)
157+
}
155158

156159
// Handle 3 cases
157160
// 1. Issue

packages/opencode/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
"@opencode-ai/plugin": "workspace:*",
5555
"@opencode-ai/script": "workspace:*",
5656
"@opencode-ai/sdk": "workspace:*",
57-
"@opentui/core": "0.1.32",
58-
"@opentui/solid": "0.1.32",
57+
"@opentui/core": "0.1.33",
58+
"@opentui/solid": "0.1.33",
5959
"@parcel/watcher": "2.5.1",
6060
"@solid-primitives/event-bus": "1.1.2",
6161
"@pierre/precision-diffs": "catalog:",

packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export function DialogSessionList() {
1818

1919
const [toDelete, setToDelete] = createSignal<string>()
2020

21+
const deleteKeybind = "ctrl+d"
22+
2123
const options = createMemo(() => {
2224
const today = new Date().toDateString()
2325
return sync.data.session
@@ -30,7 +32,7 @@ export function DialogSessionList() {
3032
}
3133
const isDeleting = toDelete() === x.id
3234
return {
33-
title: isDeleting ? "Press delete again to confirm" : x.title,
35+
title: isDeleting ? `Press ${deleteKeybind} again to confirm` : x.title,
3436
bg: isDeleting ? theme.error : undefined,
3537
value: x.id,
3638
category,
@@ -60,7 +62,7 @@ export function DialogSessionList() {
6062
}}
6163
keybind={[
6264
{
63-
keybind: Keybind.parse("ctrl+d")[0],
65+
keybind: Keybind.parse(deleteKeybind)[0],
6466
title: "delete",
6567
onTrigger: async (option) => {
6668
if (toDelete() === option.value) {

packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ export function Autocomplete(props: {
4949
})
5050
const filter = createMemo(() => {
5151
if (!store.visible) return
52-
return props.value.substring(store.index + 1).split(" ")[0]
52+
// Track props.value to make memo reactive to text changes
53+
props.value // <- there surely is a better way to do this, like making .input() reactive
54+
55+
const val = props.input().getTextRange(store.index + 1, props.input().visualCursor.offset + 1)
56+
57+
return val
5358
})
5459

5560
function insertPart(text: string, part: PromptInfo["parts"][number]) {
@@ -70,7 +75,7 @@ export function Autocomplete(props: {
7075

7176
const virtualText = "@" + text
7277
const extmarkStart = store.index
73-
const extmarkEnd = extmarkStart + virtualText.length
78+
const extmarkEnd = extmarkStart + Bun.stringWidth(virtualText)
7479

7580
const styleId =
7681
part.type === "file"
@@ -364,7 +369,7 @@ export function Autocomplete(props: {
364369
return store.visible
365370
},
366371
onInput(value: string) {
367-
if (store.visible && value.length <= store.index) hide()
372+
if (store.visible && Bun.stringWidth(value) <= store.index) hide()
368373
},
369374
onKeyDown(e: KeyEvent) {
370375
if (store.visible) {
@@ -378,7 +383,10 @@ export function Autocomplete(props: {
378383
if (e.name === "@") {
379384
const cursorOffset = props.input().visualCursor.offset
380385
const charBeforeCursor =
381-
cursorOffset === 0 ? undefined : props.value.at(cursorOffset - 1)
386+
cursorOffset === 0
387+
? undefined
388+
: props.input().getTextRange(cursorOffset - 1, cursorOffset)
389+
382390
if (
383391
charBeforeCursor === " " ||
384392
charBeforeCursor === "\n" ||

packages/opencode/src/cli/cmd/tui/util/clipboard.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ export namespace Clipboard {
3030
}
3131

3232
if (os === "linux") {
33-
const wayland = await $`wl-paste -t image/png`.nothrow().text()
34-
if (wayland) {
35-
return { data: Buffer.from(wayland).toString("base64url"), mime: "image/png" }
33+
const wayland = await $`wl-paste -t image/png`.nothrow().arrayBuffer()
34+
if (wayland && wayland.byteLength > 0) {
35+
return { data: Buffer.from(wayland).toString("base64"), mime: "image/png" }
3636
}
37-
const x11 = await $`xclip -selection clipboard -t image/png -o`.nothrow().text()
38-
if (x11) {
39-
return { data: Buffer.from(x11).toString("base64url"), mime: "image/png" }
37+
const x11 = await $`xclip -selection clipboard -t image/png -o`.nothrow().arrayBuffer()
38+
if (x11 && x11.byteLength > 0) {
39+
return { data: Buffer.from(x11).toString("base64"), mime: "image/png" }
4040
}
4141
}
4242

@@ -47,7 +47,7 @@ export namespace Clipboard {
4747
if (base64) {
4848
const imageBuffer = Buffer.from(base64.trim(), "base64")
4949
if (imageBuffer.length > 0) {
50-
return { data: imageBuffer.toString("base64url"), mime: "image/png" }
50+
return { data: imageBuffer.toString("base64"), mime: "image/png" }
5151
}
5252
}
5353
}

packages/web/src/content/docs/keybinds.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ OpenCode has a list of keybinds that you can customize through the OpenCode conf
2323
"session_unshare": "none",
2424
"session_interrupt": "escape",
2525
"session_compact": "<leader>c",
26+
"session_child_cycle": "ctrl+right",
27+
"session_child_cycle_reverse": "ctrl+left",
2628
"messages_page_up": "pageup",
2729
"messages_page_down": "pagedown",
2830
"messages_half_page_up": "ctrl+alt+u",

0 commit comments

Comments
 (0)