Command Window Interface
Changing the background colorThe background color is controlled by the PROMPT variable. This variable can be fixed in the CONFIG.SYS file, in which case it applies to all command windows. It can be also changed locally, for a given command window object, by entering the appropriate instructions in the Parameters section of the Program page of the settings notebook. The command PROMPT locally changes the value of the PROMPT variable.
The following is the list of display attributes that figure in the PROMPT variable.
In addition to this: 0=Attributes off (black on white display), 1=Bold, 2=Normal, 5=Blinking, 7=Reverse Colors and 8=Invisible.
These attributes are used within a prompt escape sequence:
Changing the size of the Command WindowThe size of the command window is controlled by using the MODE command, as follows
To create a command window object that always opens with given dimensions (x,y) it is sufficient to put
Another way to permanently change the size of a command window object is to to hold the Left-Shift key while resizing the window.
Long commandsIf a command string is too long to fit into a single line--pressing ^-Enter switches to a new line. It is not allowed to break a command string in the middle of a word.
Multiple Commands and Special SymbolsTo execute multiple commands within one command string, it is necessary to separate the commands by the ampersand symbol &.
The two ampersand symbols A&&B is the conditional execution--the command B will run only if A succeeds. Similarly A||B executes B only if A fails. The standard brackets ( ) can be used as grouping symbols within a command string. The symbol | pipes the output of the preceding command.
The symbols < and > are used to redirect the inputs and outputs respectively. Redirected output replaces any existing data. In order to append the redirected output, use >>.
Starting SessionsThe START command is used to launch an arbitrary OS/2 program, and to return the control to the command window (so that other commands can be executed from the same window).
The syntax is:
START "OptionalName" </k /c /n> </fs /win> </f /b> </pm /dos>
Moving left/right within a command lineTo jump from one word to the beginning of a neighbouring one use Ctrl-Left and Ctrl-Right keys. Use Home/End to move to the beginning/end of the command line. Requires keys=ON.
Re-calling CommandsBy default, OS/2 keeps a short command-line history in a special buffer. It is possible to scroll through this list by using Up and Down arrow keys. It is possible to scroll through the restricted list of all executed commands that begin with a fixed character combination--by typing this combination and then consecutively pressing the F1 key. Requires keys=ON.
Shutting Down from a Command WindowTo initiate the WPS shutdown use the SHUTDOWN command. The executable SHUTDOWN.EXE is located in X:\OS2\INSTALL directory.