blink icon indicating copy to clipboard operation
blink copied to clipboard

Terminal does not handle SOH/STX characters.

Open ccrusius opened this issue 2 years ago • 1 comments

Checklist

Describe the bug

Shell prompts that include SOH/STX characters are not handled properly. Using these characters is the "proper" way to enclose control sequences (such as SGR color change commands) in what otherwise is text. From the looks of it, the cursor position is incremented for each of those characters, even though they are supposed to be invisible. As an example, instead of this

some-prompt-with-soh-stx% ▮

(where ▮ is the cursor), we have

some-prompt-with-soh-stx%       ▮

Here's the hexdump of one of my prompts for testing:

0000000 1b01 315b 016d 5b1b 3439 026d 6363 7572
0000010 6973 7375 1b01 305b 026d 1b01 325b 6d32
0000020 1b01 335b 6d34 4002 1b01 305b 026d 1b01
0000030 315b 016d 5b1b 3439 026d 6c67 7061 6f74
0000040 0170 5b1b 6d30 0102 5b1b 3239 026d 013a
0000050 5b1b 6d30 0102 5b1b 3232 016d 5b1b 3333
0000060 026d 6d74 7875 643a 6665 7561 746c 1b01
0000070 305b 026d 1b01 395b 6d32 3a02 1b01 305b
0000080 026d 1b01 325b 6d32 1b01 335b 6d36 7e02
0000090 1b01 305b 026d 0020
0000097

ccrusius avatar Jun 24 '22 18:06 ccrusius

#1836

carloscabanero avatar Oct 01 '23 21:10 carloscabanero