What's the meaning of "?]0;"

429 views Asked by At

when I connect to a ssh in powershell

I got such strings

?]0;wany@wany02: ~?[01;32mwany@wany02?[00m:?[01;34m~?[00m$

I print the bytes of the string

[27 93 48 59 119 97 110 121 64 119 97 110 121 48 50 58 32 126 7 27 91 48 49 59 51 50 109 119 97 110 121 64 119 97 110 121 48 50 27 91 48 48 109 58 27 91 48 49 59 51 52 109 126 27 91 48 48 109 36 32]

I've used the [ansicolor]: https://github.com/shiena/ansicolor package to convert color

but,what the meaning of "?]0;wany@wany02: ~?"

I can't see it on Linux terminal

thx a lot

1

There are 1 answers

0
Shawn On

ESC]0; is the start of an escape code that xterm and compatible terminals that implement VT100 control sequences use to change the window's title and icon name. The byte with the value 7 (ASCII BEL) ends the sequence. Everything between is used as the title.

Using 2 instead of 0 changes just the title and 1 just the icon name. See the list of operating system controls for what other numbers do.