summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLuke Parker <[email protected]>2025-11-17 17:08:22 +1000
committerGitHub <[email protected]>2025-11-17 01:08:22 -0600
commit5731c268b6c6cc00ab288ca2118f469fb1a6bc1e (patch)
treec209bd35f99f483f7156ff88aa4441b267701a51
parentf4d892d4e1f42734c5ecc438163ec1dccc2ef7fc (diff)
downloadopencode-5731c268b6c6cc00ab288ca2118f469fb1a6bc1e.tar.gz
opencode-5731c268b6c6cc00ab288ca2118f469fb1a6bc1e.zip
fix: Line count on win (#4401)
-rw-r--r--packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
index a7f248758..b33f2ac63 100644
--- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
@@ -665,7 +665,11 @@ export function Prompt(props: PromptProps) {
return
}
- const pastedContent = event.text.trim()
+ // Normalize line endings at the boundary
+ // Windows ConPTY/Terminal often sends CR-only newlines in bracketed paste
+ // Replace CRLF first, then any remaining CR
+ const normalizedText = event.text.replace(/\r\n/g, "\n").replace(/\r/g, "\n")
+ const pastedContent = normalizedText.trim()
if (!pastedContent) {
command.trigger("prompt.paste")
return