2

I'm working on a small server application in C# which should provide a VT100/ANSI terminal interface (either via telnet, or modem).

I'm doing some research on VT100/ANSI and the more I read, the more I get confused. I want to implement a simple parser for dealing with ansi escape/control sequences, but the specs contain a lot of possible commands. Basically, my questions boil down to this:

1) Which commands should I implement if I deal with telnet-based clients (like putty), or a simple dialup program (like minicom or hyperterminal). I'm sure a lot of the escape sequences are simply not used or ignored in those apps.

2) Do I only need to process C0 control chars when they are prefixed with the ESC character? Or also when I encounter them in a normal text sequence? I cannot derive this crucial bit of information from the docs.

3) Should I care about private control sequences?

Thanks in advance,

Jeroen.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
Jeroen Jacobs
  • 1,423
  • 3
  • 16
  • 32

1 Answers1

2

You will have to detect the escape sequences in any case; however, you do not need to interpret all of them, but at least you should be able to skip them.

For instance Esc[5m turns on blinking mode. If you want to ignore this mode, just skip "Esc[5m".

I do not think that the C0 control characters are prefixed with ESC.

I never encountered these private control sequences. Wait to see if they are used. There is no point in implementing something that might never be used.

Olivier Jacot-Descombes
  • 104,806
  • 13
  • 138
  • 188
  • true, but I think some of them are not really optional. For example, I don't think I can get away with ignoring the XON/XOFF command sequences, and I should at least respond to an ESC [c (=Query Device Code), I think. And then there some C0 commands where I'm totally clueless about, for example: the C0 codes SOH (= start of header), EM (= End of Medium), etc ... – Jeroen Jacobs Mar 22 '12 at 22:00
  • Not all of these codes will be used. Only experimentation will help. XON/XOFF are part of communication protocols and are not used for display control. – Olivier Jacot-Descombes Mar 22 '12 at 22:17