### Using shell windows

A window can be set to shell mode using the Settings menu. Also, you may toggle a window between being a regular document and being a shell by clicking the shell rectangle in the status bar:

In shell mode shell commands can be executed just as in a terminal shell. You may for instance type ls and hit return. Unlike a terminal shell one can store the commands in the document and reuse them because a shell window in Eddie saves and allows editing same as a regular document window. This gives the user a convenient alternative to having a shell history - common shell commands or interresting shell command output can be saved in the shell document for next time. There is an actual bash shell running in each shell window. You can use make, cd, ls, grep, etc. You may set shell variables, aliases and other shell state. In addition Eddie defines some builtin shell commands. Editing still works the way it does in other document windows.

#### Executing commands in a Shell window

To execute a shell command, you type the command in and hit return:

You will get something like:

If you select a part of a line and hit return, only the selected part will get executed:

In our example the output of ls gets inserted right after the executed command:

Note that only the selected ls part of the command got executed, the grep part was ignored. Also note that unlike in a normal edit, when executing a selection in the shell window, the executed selection does not get deleted first.

To get rid of temporary shell output and keep it from poluting your shell window, you may use Undo.

#### Special shell window shortcuts

Return | executes a selection or an entire line as a shell script
Ctrl-Return | acts as Return in a normal window - it just inserts a new line. This is usefull when you do not wan't to execute the line you just typed in
Ctrl-C | sends a break signal to the shell, stopping makes, etc.
Tab | completes a path; repeated use will bring up a popup panel with suggested completions
Ctrl-Tab | inserts a tab character

As with most other keyboard shortcuts, all of the above can be remapped. You may for instance prefer the more MPW-like mapping of Enter to act as na execute command and Return to just insert a newline. You may do this by customizing your UserStartup file with the SetKey commands.

#### Shell prompts

Shell prompts appear in the status rectangle in the button bar. If the shell is executing, a prompt will be light blue - in the following example the shell window is busy executing a sleep command:

As with a terminal shell, you can customize the prompt format by adding a corresponding entry to the ~/.profile file. You may for instance add the following line:

    PS1="\$PWD"" :"

Note that the shell does not support terminal escape sequences. It is therefore not possible to run tools like vi and more. Hopefully the editor text editing capabilities will offset for this deficiency.

#### Pathname Tab completion

Eddie Shell windows support tab completion. You can type in one or two characters of a path and hit Tab, Eddie will fill in the remainder of a path, unless there are several completions that can match the characters you already typed in. You may combine typing a character or two and hitting Tab repeatedly, just like in the Bash shell. When there are multiple or no possible completions, Eddie beeps.

If you hit Tab again, Eddie will suggest possible completions in a temporary panel. The panel will disappear once you click the mouse or type another key. Like Bash, Eddie will complete shell variables and use them when expanding pathnames. Unlike Bash, Eddie will leave the variable in it's original symbolic form, the completion mechanism evaluates it though to suggest a completion.
Note that Eddie currently does not complete everything in your current $PATH, just absolute paths and paths relative to your current directory.