The command area in the ConsoleHoster application is active project specific: each open project gets its isolated from others command area. Users are allowed to type in free text into the command area to execute. The commands supported in this command area are the same, which will work for the original underlying process – opened within windows console host. So in case of the underlying process is the cmd.exe, one of the well-known commands will be the “dir” command, which will output the contents of the active directory.

Despite of the simple – one-line commands the command area allows the users to type in multiline commands, so those will be executed one by one after execution – keeping the order in which those have been sent. To do so, the user should hit the “Ctrl+Enter” not to send the currently typed command, but to jump to another line of the command area, like shown in the following picture:

image

Here there are the following 4 line command typed in the command area:

cd ..
dir
d:
cd \

After hitting Enter, the first command (cd..) will be executed and will take the user one level up from the current directory, which will be: C:\Users\Artak.Mkrtchyan\Desktop\ConsoleHoster Documentation\

The second command (dir) will execute after the first command will be executed, thus the output will be the contents of the above mentioned directory.

Then the third command (d: ) will execute, and make the d drive’s active folder as current.

And finally the last forth command (cd \ ) will redirect the user to the root of the d drive (d:\ ).

Here is the snapshot of the result of execution of the above command:

image

Despite of just command execution the command area supports few more features. The most exciting one is that the user have the ability to get path suggestions for any input by hitting Tab. So for example if we’ll type in now the d:\ in the command prompt and then hit tab sequentially, on each hit the next path suggestion will come up in the following order:

d:\$RECYCLE.BIN

d:\Documentation

d:\Install

d:\iPad

To narrow down the list of the options, user can type in the prefix of the looking items. So if for example the initial text in the command area will be d:\d and then Tab, then the only option which will come up is the “d:\Documentation”. The good thing is that this is not limited to full paths, but the user can have the same feature work for relative paths as well. So because the current folder now is the root of the d drive, the “d:\” prefix can be either skipped or just replaced by “./”, and the result will be absolutely the same.

Each command executed is being saved internally for that specific console, which for it was executed, for future use of it. So if the user has executed dir and the cd.. commands, then when traversing through the list of command the user will see both. To traverse through the mentioned list the user need to hit the “Up” or “Down” arrows each will traverse the list in a different direction. The behavior changes a bit for multiline commands, where the up and down keys start to navigate through the command text, instead of the history of the commands. This is handy to make changes to multiline commands.

Users have the preference to expand the commands area by just dragging the splitting line between commands and output areas up.

Last edited Aug 28, 2012 at 3:35 AM by mkArtak, version 3

Comments

No comments yet.