14

In the Microsoft Windows Command Prompt (Win7), what does the command Ctrl+N do?

I get the following output:

C:\Users\pbarney>^N
'' ␋_ ┼¯├ _␊␌¯±┼␋≥␊␍ ▒_ ▒┼ ␋┼├␊_┼▒┌ ¯_ ␊│├␊_┼▒┌ ␌¯└└▒┼␍,
¯▬␊_▒␉┌␊ ▬_¯±_▒└ ¯_ ␉▒├␌␤ °␋┌␊.

I recognize that the preceding line is similar in length to the following message when you type an invalid command:

'a' is not recognized as an internal or external command,
operable program or batch file.

I'm curious why it does this.

1

2 Answers 2

5

The ASCII standard has two code points, SHIFT OUT and SHIFT IN that switch between two different modes.

Historically, these were black and red typewriter ribbon. The instance you see is a VT100 compatible terminal emulator, which uses these to switch between regular text and line drawing characters. This is a simple data compression standard, in which bit 7 of each character is set from the current shift state rather than transferred, which gives a slight speed boost over a serial link.

1
  • I see now! Ctrl+N is shift out, and Ctrl+O is shift in, so ^Ntest^Otest shows this: ├␊_├test
    – pbarney
    Jul 14, 2014 at 14:40
16

It is a "not recognized as an internal or.... " message, but it seems that it isn't displaying correctly. Be sure that command prompt fonts are set to raster.

If I paste the output here, I get the same scrambled characters you do, presumably due to character encoding. Here's the cmd output as a screenshot:

enter image description here

It seems as if the symbol is a UTF-8 symbol, since N++ won't render it correctly in ANSI, but will in UTF-8

U+266B  ♫   e2 99 ab    BEAMED EIGHTH NOTES

http://www.utf8-chartable.de/unicode-utf8-table.pl?start=9728

You will notice that pressing Ctrl and other letters will produce other symbols, such as the spades symbol for Ctrl+E

4
  • It occurs for me with raster fonts as well, but the thing I'm most curious about is WHY the output is in a different character coding.
    – pbarney
    Jul 13, 2014 at 19:14
  • 4
    This does a better job at explaining it than I can: stackoverflow.com/questions/1259084/…
    – TeknoVenus
    Jul 13, 2014 at 19:18
  • Do you know Ctrl + G causes my PC to beep?
    – TMH
    Jul 14, 2014 at 13:18
  • Ctrl + G is the "BELL" symbol, originally meant to send an audible notification beep on old terminals. Still works in the command prompt!
    – pbarney
    Aug 3, 2014 at 2:40

You must log in to answer this question.

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