Command Prompts

A command prompt in File Workbench represents any command interpretor, that takes a command string, processes it and outputs the resulting string. Most interpretors fit this pattern. Some obvious cases are:

File Workbench provides ready to use prompt configurations for these by default.

The Flavour of FWB Command Prompts


Squirrel Session command prompt_.

!/file/FileWorkbench/1
PromptWin32Cmd.png!
Win32 CMD/DOS command prompt.

| The aim is to provide a useful interface to any type of command interpreter, where the environment is quite “text-editor-like” .

The prompt will look and behave much the same regardless of what object is behind it. Command line history, input editing, word / filename completion happens in much the same way in Bash/DOS/Squirrel prompts.

The purpose has not been to provide a replica of Bash and all its features under Unix .


A Linux Bash prompt with filename completion active. A plugin GCC output parser provides hilighted and clickable errors.

Basic Functionality

The FWB shell can do these basic things:

Recognizing the Prompt

To know when a command interpreter is ready to receive new input and when it is working, FWB must know its prompt string. This string is described with a regular expression in the Command Prompt preferences dialog. Whenever FWB find a match in the output, it will color it red and consider itself ready to recive input.

For example, to recognize a Windows CMD prompt: C:> the following regular expression can be used:

@ $ @

If using a different shell or a different prompt in the bash/cmd, you will have to tweak the prompt expression.

Regular expressions is a big subject. PCRE is the same library as used in PHP. Some useful pages:

Starting a Command Prompt



| The command prompt start dialog is shown when a new Cmd Prompt MiniApp is created. Pressing Ctrl-R from inside a prompt will also always bring it up.

In this dialog one can select type of prompt to create and give it additional startup parameters, such as commands to execute on startup and the prompt regular expression.

The types SqScrEng and SqSession are both Squirrel script prompts. FWB script commands can be developed and tested from there.

Addon Functionality

Through plugin interfaces, additional command processing and output parsing can be added. For example, File Workbench has a scripted plugin that can parse GCC compiler output that generates red clickable error messages.

It is also possible to add context menu handling, command preprocessing that is specific for a prompt type and context.


On the command prompt toolbar , there are some additional commands: