Skip to content

Commit 5731c26

Browse files
authored
fix: Line count on win (#4401)
1 parent f4d892d commit 5731c26

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,11 @@ export function Prompt(props: PromptProps) {
665665
return
666666
}
667667

668-
const pastedContent = event.text.trim()
668+
// Normalize line endings at the boundary
669+
// Windows ConPTY/Terminal often sends CR-only newlines in bracketed paste
670+
// Replace CRLF first, then any remaining CR
671+
const normalizedText = event.text.replace(/\r\n/g, "\n").replace(/\r/g, "\n")
672+
const pastedContent = normalizedText.trim()
669673
if (!pastedContent) {
670674
command.trigger("prompt.paste")
671675
return

0 commit comments

Comments
 (0)