Skip to content

Esoteric bug with handling CMD+V with tabs in userInput #649

@h0x91b

Description

@h0x91b

Hi there, I found a strange esoteric bug, if I am pasting into terminal anything which starts by '\t' tab character it truncates value of the line and put instead 'i' character, it happens because tab char is less then '\x1a'.

Also if I am pasting big amount of text which tabs on some lines it does the same, but in the middle of text, since sometime it chunks it in the middle of string.

ink/src/parse-keypress.ts

Lines 194 to 197 in 1682444

} else if (s <= '\x1a') {
// ctrl+letter
key.name = String.fromCharCode(s.charCodeAt(0) + 'a'.charCodeAt(0) - 1);
key.ctrl = true;

I am suggest to check length of string and do some special handling for symbols like '\t'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions