fix(tui): decode CSI-u Ctrl+letter inside bracketed paste, fixes #3599 (#3623)

Co-authored-by: Georgi Chochev <georgi.chochev@siteground.com>
This commit is contained in:
Georgi
2026-04-24 14:30:49 +03:00
committed by GitHub
parent 6e6c9b4d28
commit d06db09a53
2 changed files with 23 additions and 1 deletions

View File

@@ -1677,6 +1677,16 @@ describe("Editor component", () => {
assert.strictEqual(editor.isShowingAutocomplete(), false);
});
it("decodes CSI-u Ctrl+letter sequences inside bracketed paste (tmux popup)", () => {
const editor = new Editor(createTestTUI(), defaultEditorTheme);
// tmux popups with extended-keys-format=csi-u re-encode \n in pastes as
// \x1b[106;5u (Ctrl+J). Without decoding, the per-char filter strips ESC
// and leaks "[106;5u" between lines. See issue #3599.
editor.handleInput("\x1b[200~line1\x1b[106;5uline2\x1b[106;5uline3\x1b[201~");
assert.strictEqual(editor.getText(), "line1\nline2\nline3");
});
it("undoes multi-line paste atomically", () => {
const editor = new Editor(createTestTUI(), defaultEditorTheme);