Shift Out Escape Sequence

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've been messing around with writing an ssh/telnet client for Windows
in C#.  It has been quite a challenge learning what ascii, ansi, and
what terminal emulation is, and how to convert terminal escape sequences
into something a richtextbox can understand. :)

I am having a problems finding a good reference to what the Shift Out
sequence will actually do.  I understand that it will set the character
set to "G1" ( , but what exactly
is "G1"?

For example, my SSH client connects to a Linux box.  I run "make
menuconfig", and "q" characters follow after a Shift Out escape
sequence.  The q's should actually be "-" characters, which form a
graphical box around the text of the menu, according to how Putty
displays the menuconfig graphic.  Here is a snippet of the output:

    Code maturity level options  --->

Forgive me if some of my verbage is wrong.  I am still learning this
stuff.  Any explanation on what this G1 character set is would be much
appreciated.  As a side note, does C# have a structure that will convert
bytes to this "G1" character set?

Thanks in advance,

Re: Shift Out Escape Sequence

Quoted text here. Click to load it

G1 is the name of a slot in the terminal state in which a character
set can be put (as are all of G0-G3), rather than designating specific
a character set. The actual set of glyphs you get depends on what
you've selected for that slot with another escape sequence (as
described on that ISO 2022 page).

Quoted text here. Click to load it

Look earlier in the log and you should see a sequence like ESC ( 0 or
similar, which selects a line-drawing character set for G1;
thereafter, SO actually selects G1 and hence line-drawing characters,
and SI switches back to G0 which presumably has ASCII characters. (I'm
not sure what G1 is supposed to have in it at terminal reset, but
experimentally it's not the line-drawing set.)

(I don't think the line-drawing character set is actually part of the
ISO 2022 standard as such -- I think it's a DEC invention -- but it's
widely implemented in terminal emulators.)

Site Timeline