Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Bug] - web console wrongly echoes CSI escape sequences #871

Open
krobelus opened this issue Jan 3, 2025 · 5 comments
Open

[Bug] - web console wrongly echoes CSI escape sequences #871

krobelus opened this issue Jan 3, 2025 · 5 comments
Labels
aws-integration An issue integrating with an AWS Service bug Something isn't working

Comments

@krobelus
Copy link

krobelus commented Jan 3, 2025

Describe the bug

The Web Console seems to fail to parse certain CSI escape sequences, and ends up echoing them.
This is unfortunate because it causes annoying glitches with programs like text editors and shells that use the kitty keyboard protocol

To Reproduce

  1. In the web console run printf '\x1b[=5u'
  2. See that 5u is echoed.

Expected behavior

Nothing should be echoed, since the string is a CSI-prefixed escape sequence

Additional context
Originally reported at fish-shell/fish-shell#10994

krobelus added a commit to fish-shell/fish-shell that referenced this issue Jan 3, 2025
We unconditionally request kitty keyboard protocol's progressive
enhancements.

It seems that a lot of terminals fail to parse CSI commands that
contain '=' such as \x1b[=5u.

1. [Midnight Commander](MidnightCommander/mc@0ea77d2)
2. Prompt 3 App (private bug tracker)
3. JetBrains IDEs https://youtrack.jetbrains.com/issue/IJPL-166234
4. Termux termux/termux-app#4338
5. Amazon Linux Web Console amazonlinux/amazon-linux-2023#871

It is difficult to fix the four remaining ones in a
timely manner, so let's query for support as described in
https://sw.kovidgoyal.net/kitty/keyboard-protocol/#detection-of-support-for-this-protocol
This uses CSI 5 n (device status report), which is the older brother
of CSI 6 n (cursor position report) we use as of recently.

Query asynchronously and enable progressive enhancements as soon
as we get a response. In theory this allow `cat malicious-file.txt`
leading us to believe the protocol is supported.

See #10994
@stewartsmith stewartsmith added bug Something isn't working aws-integration An issue integrating with an AWS Service labels Jan 9, 2025
@stewartsmith
Copy link
Member

Thanks for the report, I'll reach out to the internal team that owns the console is aware of the issue.

For clarification: are you finding this on "Get system log", "Get instance screenshot", EC2 Serial Console, or EC2 Instance Connect?

@krobelus
Copy link
Author

krobelus commented Jan 9, 2025

For clarification: are you finding this on "Get system log", "Get instance screenshot", EC2 Serial Console, or EC2 Instance Connect?

I'm not sure; @munntjlx would know.

@munntjlx
Copy link

This is more of "incorrect terminal emulation on the web console"

@munntjlx
Copy link

instance connect

@stewartsmith
Copy link
Member

Thanks, I've directed that team to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws-integration An issue integrating with an AWS Service bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants