Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
h0x91b opened this issue Mar 11, 2024 · 1 comment
Open

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

h0x91b opened this issue Mar 11, 2024 · 1 comment

Comments

@h0x91b
Copy link

h0x91b commented Mar 11, 2024

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'

@i-am-the-slime
Copy link

Yeah, pasting longer strings breaks for me, too, I have to glue a string together from multiple event calls. I have a heuristic based on time.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants