Command Line Editing

The command line works like a single-line word processor, allowing you to edit any part of the command at any time before you press Enter to execute it (or Esc to erase it).

 

The command line as typed (before alias and variable expansion) can contain up to a maximum of 65,535 characters. See Command Line Length Limits.

 

You can use the following editing keys (among others) when you are typing a command (the words Ctrl and Shift mean to press the Ctrl or Shift key together with the other key named). The keystrokes listed here are the default values, but most editing keys can be redefined via Command Line Editing Keys or General Input Keys directives.

 

Cursor Movement Keys:

 

Left

Move the cursor left one character

Right

Move the cursor right one character

Ctrl-Left

Move the cursor left one word

Ctrl-Right

Move the cursor right one word

Home

Move the cursor to the beginning of the command

End

Move the cursor to the end of the command

Alt-Shift-Left

Move the cursor left to the beginning of the argument (supports quoted arguments).

Alt-Shift-Right

Move the cursor right to the next argument (supports quoted arguments).

Insert and Delete Keys:

 

Ins

Toggle between insert and overstrike mode (cursor shape indicates mode)

Del

Delete the character under (or to the right of) the cursor, or the highlighted text

Bksp

Delete the character to the left of the cursor, or the highlighted text

Ctrl-L

Delete the word or partial word to the left of the cursor

Ctrl-R or Ctrl-Bksp

Delete the word or partial word to the right of the cursor

Ctrl-Home

Delete from the beginning of the line to the cursor

Ctrl-End

Delete from the cursor to the end of the line

Esc

Delete the entire line

Ctrl-V

Paste the first line of text from the clipboard at the current cursor position

Ctrl-Shift-V

Insert a " & " between lines of a multiline paste

Ctrl-B

Paste the last argument from the previous command line

Ctrl-0 to Ctrl-9

Paste the corresponding argument from the previous command line

Redo

Redo the previous undo

Undo

Undo the last edit

 

Highlighting:

 

Shift-Right

Highlight character right of cursor and move cursor

Shift-Left

Highlight character left of cursor and move cursor

Shift-Home

Highlight from cursor to beginning-of-line and move cursor

Shift-End

Highlight from cursor to end-of-line and move cursor

Ctrl-Shift-Right

Highlight word right of cursor and move cursor

Ctrl-Shift-Left

Highlight word left of cursor and move cursor

Ctrl-Y

Copy highlighted text to the clipboard

Ctrl-C

Copy highlighted text to the clipboard (if it exists); otherwise cancel the command.

 

Execution:

 

Ctrl-K

Save the current command line in the history list without executing it, and then clear the command line

Ctrl-C or Ctrl-Break

Cancel the command line without saving in the history list

Enter

Execute the command line

 

Miscellaneous:

 

F1

Get help for the command (first argument on the line)

Ctrl-F1

Get help for the current word

Alt-F1

Call the command dialog for the command (only argument on the line)

Ctrl-F

Expand a command or directory alias

Ctrl-X

Expand all variables on the command line

Ctrl-Shift-X

Expand the variable or function at the current cursor position

Ctrl-A

Toggle between LFN and SFN

Shift-F6

Toggle between files+directories and directories only

Ctrl-F6

Toggle between local directory and local directory + PATH

Alt-PgUp, Alt-PgDn, Alt-Home, Alt-End, Alt-Up, Alt-Down

Scroll the window within the console buffer. (Use the cursor pad keys, not the numeric keypad keys.)

Ctrl-+

(On the numeric keypad.) Increase the font size in a TCC console window. (You must be using a TrueType font.)

Ctrl--

(On the numeric keypad.) Decrease the font size in a TCC console window. (You must be using a TrueType font.)

Ctrl-Win-Left

Decrease the TCC console window width.

Ctrl-Win-Right

Increase the TCC console window width.

Ctrl-Win-Up

Decrease the TCC console window height.

Ctrl-Win-Down

Increase the TCC console window height. You cannot increase the window height beyond the number of rows in the console screen buffer.

Alt-Win-Left

Move the TCC console window left 5 pixels.

Alt-Win-Right

Move the TCC console window right 5 pixels.

Alt-Win-Up

Move the TCC console window up 5 pixels.

Alt-Win-Down

Move the TCC console window down 5 pixels.

 

To highlight text on the command line use the mouse or hold down the Shift key and use any of the cursor movement keys listed above. You can select a complete word by placing the cursor anywhere in the word and double-clicking with the mouse. Once you have selected or highlighted text on the command line, any new text you type will replace the highlighted text. If you press Bksp or Del while there is text highlighted on the command line, the highlighted text will be deleted.

 

TCC does not turn off the selection if you use the left or right cursor keys (or Shift-Left, Shift-Right, Shift-Ctrl-Left, or Shift-Ctrl-Right). So selection (marking) from the keyboard (Shift-Left / Shift-Right) allows you to go back to the selection (inside the selection or immediately before or after) and resize it with Shift-Left / Shift-Right) again.

 

While you are working at the prompt you can use the clipboard to copy text between TCC and other applications (see Highlighting and Copying Text for additional details). You can also use Drag and Drop to paste a filename from another application onto the command line.

 

Most of the command line editing capabilities are also available when you are prompted for a line of input. For example, you can use the command line editing keys when DESCRIBE prompts for a file description, when INPUT prompts for input from an alias or batch file, or when LIST prompts you for a search string.

 

If you want your input at the command line to be in a different color, you can use the Windows tab of the configuration dialogs.

 

TCC will prompt for additional command line text when you include the escape character as the very last character of a typed command line. (The default escape character is the caret "^".) For example:

 

echo The quick brown fox jumped over the lazy ^

More? sleeping dog. > alphabet

 

Sometimes you may want to enter one of the command line editing keystrokes on the command line instead of performing the key's usual action. For example, suppose you have a program that requires a Ctrl-R character on its command line. Normally you couldn't type this keystroke at the prompt, because it would be interpreted as a "Delete word right" command. To get around this problem, use the special keystroke Alt-255. You enter Alt-255 by holding down the Alt key while you type 0255 on the numeric keypad, then releasing the Alt key. This forces TCC to interpret the next keystroke literally and place it on the command line, ignoring any special meaning it would normally have as a command line editing or history keystroke. You can use Alt-255 to suppress the normal meaning of command line editing keystrokes even if they have been reassigned with key mapping directives, and Alt-255 itself can be reassigned with the CommandEscape configuration option.

 

Alternative Keyboard Input Method:

 

The method mentioned above for Alt-255 can be used to generate other characters. You must use the number keys on the numeric keypad, not the row of keys at the top of your keyboard. When this Alt + keypad approach is used in a Unicode environment, TCC will assume that a 3-digit decimal value means an ASCII character, while a 4-digit decimal value mean a Unicode glyph. Make sure that your hardware, character set, code page and font all support the desired combination. Use caution with this method if you plan on manipulating the generated character in other Windows components. See the section on ASCII, Key Codes and ANSI X3.64 Commands for some additional information.