CTRL+PRINT SCREEN Causes ANSI Escape Sequences to Print (73314)



The information in this article applies to:
    Microsoft MS-DOS operating system 3.1
    Microsoft MS-DOS operating system 3.2
    Microsoft MS-DOS operating system 3.21
    Microsoft MS-DOS operating system 3.3
    Microsoft MS-DOS operating system 3.3a
    Microsoft MS-DOS operating system 4.0
    Microsoft MS-DOS operating system 4.01
    Microsoft MS-DOS operating system 5.0
    Microsoft MS-DOS operating system 6.0
    Microsoft MS-DOS operating system 6.2
    Microsoft MS-DOS operating system 6.21
    Microsoft MS-DOS operating system 6.22

This article was previously published under Q73314

SUMMARY

If you use ANSI escape sequences in the PROMPT command ($E) and turn on continuous print by pressing CTRL+PRINT SCREEN, the ANSI escape sequences used in the prompt will be printed when you press ENTER.

MORE INFORMATION

When working from the command prompt, CTRL+PRINT SCREEN will print continuous output in a mirror image of the computer screen. If you used ANSI escape sequences to customize the command prompt with $E, the prompt, including the ANSI characters used in the PROMPT command, will be printed. The following example shows a prompt using ANSI escape codes to set the command prompt to magenta on black, and how it prints out using CTRL+PRINT SCREEN:

Prompt setting: PROMPT $e[35;40m$p$g$e[37;40m
How it will print: 35;40mC:\>37;40m

If this output is unacceptable, the prompt can be changed from the command line by issuing the following command:

PROMPT $P$G

To set the prompt to its previous setting, restart the computer.

Modification Type: Major Last Reviewed: 5/12/2003
Keywords: KB73314