Skip to main content

Input, Output, and Error Colors in TCC

There's a certain rhythm to using a command shell, the regular alternation of command and output, command and output. This cycle isn't always obvious when scrolling back through the console buffer. When all of the text looks the same, it can be hard to spot where one command's output ends and the next command begins. One of the simplest customizations you can make is to change the input color, and it's surprising how much easier it is to interpret text on the screen when your input is visually distinct from the shell's output. To tweak the input color, start the OPTION dialog. Select the Windows tab, and pick a new Input Foreground; you can change the Background too if you like.

In addition to commands you type at the prompt, Input Colors also colors user input to internal commands like INPUT and ESET.

While you're on the Windows tab, you can also set the Error color. TCC uses this setting for error messages displayed by internal commands. It's an easy way to make errors visually distinct from other output, again making it easier for your eyes to parse the text in the console window.

Error Colors also colors the ECHOERR and ECHOSERR internal commands. It has no effect on external commands.

Syntax Coloring in TCC

TCC supports syntax coloring on the command line (similar to the syntax coloring in the IDE / batch debugger). You set the option and the colors to use in the OPTION / Windows dialog. You can define both foreground and background using any of the 16 Windows console colors. TCC will colorize:

  • Default - any text that doesn't match a syntax option
  • Commands - internal TCC commands
  • Aliases - command aliases defined with the TCC ALIAS command.
  • Comments - lines beginning with rem or ::
  • Labels - labels for a GOTO or GOSUB
  • Operators - | < > && || etc.
  • Batch / Local Vars - %1 - %n, %*, %~... etc.
  • Environment Vars - environment variables
  • Internal Vars - internal TCC variables and variable functions
  • Regexes - regular expressions


Copyright © 2011-2023, Charles Dye