Tips on using Shell windows

Set up your bash prompt to show current path

It is convenient set up your bash prompt in your .profile to display the current directory - making it appear in the Status bar rectangle. You may do this by adding the following line to ~/.profile :

PS1="\$PWD"": "

One convenient way of doing this is activating your Worksheet, typing

~/.profile
placing the cursor anywhere in the typed text and pressing Alt-D (Open selection). The .profile file will open and you may edit it. After saving and closing it you may either quit/restart Eddie or execute:
. ~/.profile
in the Worksheet to activate the change


Getting rid of shell command output.

To get rid of output from say a compile, you may use the Undo feature. To select all the output an execution of a shell command produced, use Undo and Redo.


Fixing compile errors when using mwcc.

When fixing syntax errors during a compile using mwcc, select an entire line containing the location of an error, emitted by the Metrowerks compiler, for example select:

File "${EDDIE_HOME}"/'Release notes'; Line 10
and hit Return. Eddie will open the file with the error and select the appropriate line. Note that this is implemented using a shell script, if instead of a full path you use say a shell variable (as in our example) and a partial path, you will get the same result.


Fixing compile errors when using gcc.

When fixing syntax errors during a compile using gcc, place the cursor anywhere in the file path name and press Alt-D.

/boot/home/src/Eddie/shell/filelist/FileList.cpp:1123: parse error before `&'
The file will open. If the error line also contains a line number as in our example, the line will get selected


Using grep from the Worksheet.

When using grep from the Worksheet, using the -n option will help opening the resulting files and selecting the corresponding line:

grep -n AddString */*/*.[ch]*
filelistwindow/FileListMisc.cpp:472: addMessage.AddString("group_name", name);
filelist/FileFinder.cpp:169: recentHeaderList->AddString(path.Path());
Here again, you may use Alt-D to open the result instantly with the matching line selected.


Entering a newline, tab.

Tab and Return have a special function in shell windows - they invoke tab completion and execute a selection respectively. To enter a Tab in a Shell/Worksheet window, press Win-Tab. To enter a newline, press Control-Tab or Win-Tab. Note that as with any other keyboard shortcut these are configurable in the UserStartup file, you may for instance remap Execute to the traditional MPW-like Alt-Return if you prefer.


Switching a text window into a shell window.

You may turn any window into a shell window quickly by clicking the empty shell icon rectangle in the button bar (rectangle next to the dirty/read only icon). This may be usefull if you want to use a shell command in a document but don't want to switch to the worksheet. After you are done with the shell command, switch back to text editing only mode by clicking the shell icon again