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

Add code 'ESC[c' into method 'strip_ansi_escape_codes' #3453

Closed

Conversation

max-dw-i
Copy link
Contributor

@max-dw-i max-dw-i commented Jul 8, 2024

Some 'MikroTik' devices add ANSI escape codes 'ESC[c' to the end of the output when in 'safe-mode'

Some 'MikroTik' devices add ANSI escape codes 'ESC[c' to the end
of the output when in 'safe-mode'
@ktbyers
Copy link
Owner

ktbyers commented Jul 8, 2024

@max-dw-i Can you show me an output capture with this character sequence? I am not seeing/finding any references to ESC[c looking at ANSI reference codes?

@max-dw-i
Copy link
Contributor Author

max-dw-i commented Jul 8, 2024

Yeah, I couldn't find either but as far as I understand there might be not typical codes.
Here is an output example:

  1. We send \u0018 (ctrl-x) to enter the safe-mode via send_command_timing:
[Safe Mode taken]
[user@HOSTNAME] <SAFE>
  1. Then run any command:
/system identity print

name: HOSTNAME
\x1b[9999B[user@HOSTNAME] <SAFE> \x1b[c

@ktbyers
Copy link
Owner

ktbyers commented Jul 8, 2024

Looks like it is probably:

Device Status
The following codes are used for reporting terminal/display settings, and vary depending on the implementation:
Query Device Code	<ESC>[c
Requests a Report Device Code response from the device.

From here:

https://www2.ccs.neu.edu/research/gpc/VonaUtils/vona/terminal/vtansi.htm

@ktbyers
Copy link
Owner

ktbyers commented Jul 8, 2024

Superceded by:

#3457

@ktbyers ktbyers closed this Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants