fix(tui): normalize tab characters in Input paste to spaces (#1975)

This commit is contained in:
xu0o0
2026-03-09 20:30:53 +08:00
committed by GitHub
parent 01f7faae9c
commit 78bf0262e5

View File

@@ -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);