From 78bf0262e50b1503384e280d7b4d9afb70aaae5f Mon Sep 17 00:00:00 2001 From: xu0o0 Date: Mon, 9 Mar 2026 20:30:53 +0800 Subject: [PATCH] fix(tui): normalize tab characters in Input paste to spaces (#1975) --- packages/tui/src/components/input.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tui/src/components/input.ts b/packages/tui/src/components/input.ts index e5c3b4f7..ff982c4e 100644 --- a/packages/tui/src/components/input.ts +++ b/packages/tui/src/components/input.ts @@ -420,7 +420,7 @@ export class Input implements Component, Focusable { this.pushUndo(); // Clean the pasted text - remove newlines and carriage returns - const cleanText = pastedText.replace(/\r\n/g, "").replace(/\r/g, "").replace(/\n/g, ""); + const cleanText = pastedText.replace(/\r\n/g, "").replace(/\r/g, "").replace(/\n/g, "").replace(/\t/g, " "); // Insert at cursor position this.value = this.value.slice(0, this.cursor) + cleanText + this.value.slice(this.cursor);