Using the Brash Console Window

This page discusses keyboard interaction and console windows.

Here's a screenshot of a normal console window. Note the scroll bars.

Scroll Bars

Microsoft has not designed the command window to be a simulation of an actual physical console or to be a simulation of the unix XTerm windows.

Instead, they designed the console window to be tool used in creating text editors -- including the ability to page vertically and horizontally. Unfortunately, a great deal of effort must be used create a simulation of an old-fashioned console window's behavior using the console library functions. Making the simulation work in all cases is an on-going task in brash's development.

Which is to say, it mostly works but the current state leaves something to be desired.

Brash works best when the console window is sized such that there is no horizontal scrollbar but there is a vertical scrollbar. Here is a picture of such configuration:

And here is an example of the console layout properties that creates it:

Note that the Window Size width is the same as the Screen Buffer Size width. The Screen Buffer Size height should be at least 200 in order to give the user some room to scroll back and see previous commands and output.

Note also that the width can be any desired size, just make the buffer and window width's the same for maximum effect. Brash will still work if you don't, but you may be forced to use the CLS command more often if you don't. See below.







CLS

The windows command, CLS, can be used to clean up the screen in the event of any cursor window confusions. To execute this command in brash, use the following command syntax: cmd /c cls The alias command in brash can be used to create a quick way to execute this command. alias cls='cmd /c cls' After the above declaration, cls will be a valid brash command. This definition should already exist in the .brashrc file available on the website.

Command Prompt

The command prompt normally defaults to something like this:
c:/curdir:
It occasionally looks different, as will be discussed below. The prompt can be changed using by setting the variable PS1 to some other value. If the variable is unspecified, which it is by default, the following value will be used:
\w:
In the above, the \w means "the current directory". Here is a list of the escape sequences that are allowed and their meanings:
SequenceExplanation
\wThe name of the current directory
\WThe basename of the current directory
\sThe basename of the brash executable that you are running. Usually brash.exe.
\uthe current user name
\hThe first node of the hostname. e.g. "node" in node.domain.company.com
\HThe full hostname
\#The command history size.

Brash Key bindings

Here is how the function keys are interpreted by brash: Console Window Edit Keys: ^C -- erase the current command, if any, and kill all running jobs -- if possible. HOME -- go to the beginning of the current input line ^A -- ditto END -- go to the end of the current input line ^E -- ditto RightArrow -- move one position to the right in the current line LeftArrow -- move one position to th eleft in the current line ^K -- delete the rest of the line ^W -- move the cursor to the next word in the current line ^Q -- move the cursor to the previous word in the current line UpArrow -- display the previous line from the command history DownArrow -- display the next line from the command history Backspace -- delete the previous character Delete -- delete the current character TAB (^I) -- 'tab completion': find the a file that matches the word to the left of the cursor and fixup differences between / and \ in file names. All other function keys are ignored. Normal data keys are interpreted as strings to be included in commands.