Skip to content

Commit c7b93a8

Browse files
committed
adapt to new paste event with raw bytes
1 parent df5f873 commit c7b93a8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages/opencode/src/cli/cmd/tui/component/prompt

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BoxRenderable, TextareaRenderable, MouseEvent, PasteEvent, t, dim, fg } from "@opentui/core"
1+
import { BoxRenderable, TextareaRenderable, MouseEvent, PasteEvent, decodePasteBytes, t, dim, fg } from "@opentui/core"
22
import { createEffect, createMemo, type JSX, onMount, createSignal, onCleanup, on, Show, Switch, Match } from "solid-js"
33
import "opentui-spinner/solid"
44
import path from "path"
@@ -936,7 +936,7 @@ export function Prompt(props: PromptProps) {
936936
// Normalize line endings at the boundary
937937
// Windows ConPTY/Terminal often sends CR-only newlines in bracketed paste
938938
// Replace CRLF first, then any remaining CR
939-
const normalizedText = event.text.replace(/\r\n/g, "\n").replace(/\r/g, "\n")
939+
const normalizedText = decodePasteBytes(event.bytes).replace(/\r\n/g, "\n").replace(/\r/g, "\n")
940940
const pastedContent = normalizedText.trim()
941941
if (!pastedContent) {
942942
command.trigger("prompt.paste")

0 commit comments

Comments
 (0)