smoegendev
smoegendev

Reputation: 53

How to send ctrl+shift+6 as ansi escape sequence?

Trying to find the ANSI escape sequence for sending the keys ctrl+shift+6 in the format \u001b.. .

I recently tried switching over to only using Windows Terminal instead of SecureCRT/Putty but i'm having issues terminating Cisco telnet/console sessions that uses ctrl+shift+6 and then x.

The terminal does not seem to recognize this or isn't forwarding it the same way as SecureCRT/Putty because nothing happens. The session is established over term VTY100 if that has any use, and the SSH-session is initiated from a Zsh-shell in a Redhat7 jumphost, the base connection comes from my Ubuntu WSL2-box.

I think I found a possible workaround as Windows Terminals allows keybinding an ansi escape sequence, but I'm unable to figure out what the sequence would look like?

Send arbitrary text input to the shell. As an example the input "text\n" will write "text" followed by a newline to the shell.

ANSI escape sequences may be used, but escape codes like \x1b must be written as \u001b. For instance "\u001b[A" will behave as if the up arrow button had been pressed.

By default this exact keybinding is used by Windows Terminal to open a new tab but I removed that.

Upvotes: 1

Views: 1560

Answers (1)

Thomas Dickey
Thomas Dickey

Reputation: 54583

The question is

Trying to find the ASCII escape sequence for sending the keys ctrl+shift+6 in the format \u001b.. .

That's referring to ctrl^, which usually is 0x1e (hexadecimal) or 036 (octal).

Based on the comment which you quoted, that would be expressed as "\u001e".

If Windows Terminal assigns that to a different code, you might open a bug report, because its developers intend to imitate xterm.

Upvotes: 4

Related Questions