If you type echo -e '\eZ' and hit return in a shell running in an xterm, you'll see that the terminal emulator prints an obscure code 1;2c. This seems to indicate that xterm interprets the VT100 control sequence \eZ (ESC Z, return terminal ID) and acts accordingly.

Now, if you press ESC Z in the same console, nothing happens. Does this mean that it is not possible to send control characters directly using the keyboard?

I'm not sure what is happening here, because pressing CTRL s (control flow) does stop the console output until you press CTRL q. So why does CTRL s/q work and not ESC Z?

  • 1
    can you please mark the answer below as correct if you are satisfied with it? Commented Apr 5, 2012 at 9:55

2 Answers 2


VT100s responded to character sequences sent to them as output. So echo'ing characters works because the terminal sees it as output. Typing characters is input; the terminal will respond only if the characters are echoed by the receiving computer. Your typical shell doesn't echo ESC, it interprets ESC as the prefix for some interactive input command. Run cat and type ESC Z RETURN and you'll see the usual VT100 response.


Also, you can press CTL-V on the keyboard usually first to tell the terminal that you want it to pass an ESC directly in instead of using it. Of course, you still have to get it echoed back to you, so doesn't necessarily help in this case, but instances where, say, you're editing a file in VIM and want to include an escape code, that's a convenient way to do so.

  • 1
    True, but this isn't what the question is about. The question asks how to send a command to the terminal, not how to input a control character literally. Commented Aug 16, 2012 at 17:57
  • @Gilles Umm, I think it is exactly about how to input a control character literally. He wants to input a control character by pressing ESC Z in the same console he ran echo -e '\eZ' in, right? Commented Apr 6, 2018 at 2:03
  • @Nick No, as Kyle's answer explains, Ernest was trying to output ESC Z. Commented Apr 6, 2018 at 6:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .