Chapter 1
Overview
Commander S is a visual shell written in Scheme. The following paragraph is the abstract of the paper ``Commander S -- The shell as a browser''[cite{GasbichlerKnauel2005}]:
Commander S is a new approach to interactive Unix shells based on interpretation of command output and cursor-oriented terminal programs. The user can easily refer to the output of previous commands when composing new command lines or use interactive viewers to further explore the command results. Commander S is extensible by plug-ins for parsing command output and for viewing command results interactively. The included job control avoids garbling of the terminal by informing the user in a separate widget and running background processes in separate terminals. Commander S is also an interactive front-end to scsh, the Scheme Shell, and it closely integrates Scheme evaluation with command execution. The paper also shows how Commander S employs techniques from object-oriented programming, concurrent programming, and functional programming techniques.
We recommend reading this paper to learn more about the ideas behind Commander S because this manual is very incomplete. If you want to extend it, please send us patches!
1.1 Installation
See the README file for information about installing Commander S.
1.2 Builtin commands
Commander S knows how to parse the output of the following commands and will display the output in the result buffer:
- ls
- ps
- printenv
- fs
- pwd
- setenv
- cd
- jobs
For the following commands, special command line completers exist:
- latex
- xdvi
- ftp
For the values returned by the following scsh procedures, Commander S possesses special viewers that allow an interactive inspection in the result buffer: user-info, group-info, host-info, protocol-info, service-info. All other Scheme values
1.3 Key bindings
Most of the key bindings are not configurable yet. See Section 1.4 to learn how to configure the rest.
1.3.1 Keybindings for the command buffer
- Switch the command mode
- [F7], (main . switch-command-buffer-mode-key)
- Switch the command mode and convert command line
- [Ctrl-x F7]
- Repaint
- [F2]
- Switch between command buffer and result buffer
- [Ctrl-x o]
- Complete command or argument
- [TAB]
1.3.2 Key bindings for the result buffer
- Paste the selection to the command buffer
- [Ctrl-x p]
- Paste the selection as focus object
- [Ctrl-x P]
- Next item of result histroy
- [page up]
- Previous item of result histroy
- [page down]
1.3.3 Line editing
The following line editing keys are available in all text input fields (e.g. the command buffer):
- Moving to the start of the line
- [Ctrl-a]
- Moving to the end of the line
- [Ctrl-e]
- Moving the cursor to the left
- [Left arrow]
- Moving the cursor to the right
- [Right arrow]
1.3.4 Select list
The following key bindings are available in all select lists, which are input widgets with multiple rows:
- Mark item
- [m], (config 'select-list 'select-list-mark-key)
- Unmark item
- [u], (config 'select-list 'select-list-unmark-key)
- Move up
- up arrow, (config 'select-list 'select-list-move-up-key)
- Move down
- down arrow, (config 'select-list 'select-list-move-down-key)
1.3.5 Select line
Select lines are input widgets with a single row and multiple columns. One column is always marked. The following key bindings are available in all select lines:
- Move column marker right
- right arrow
- Move column marker left
- left arrow
1.3.6 Key bindings for completion window
The completion window is displayed if several choices to complete the user input exist. It contains a select list (see Section 1.3.4) without the possibility to mark items.
- Exit completion window without selecting a completion
- ESC
- Select completion
- RET
1.3.7 Key bindings for process object viewer
The ps command creates a list of process objects. Besides the select list key bindings from Section 1.3.4 and the select line key bindings from Section 1.3.5, the following key bindings are active in the result viewer for this list:
- Filter processes
- [f], (ps . filter-key)
- Sort processes in increasing order
- [S], (ps . sort-up-key). Sorts according to marked column.
- Sort processes in decreasing order
- [s], (ps . sort-down-key). Sorts according to marked column.
- Select columns
- [c], (ps . columns-key). Displays a select list where the user can mark and unmark the columns to be displayed.
- Kill process
- [k], (ps . kill-key)
- Re-run ps
- [g], (ps . refresh-key). Re-runs the ps command.
- Select next process
- down arrow
- Select previous process
- up arrow
1.3.8 Key bindings for file system object viewer
The ls command creates a list of file system objects. Besides the key bindings for select lists (Section 1.3.4) and select lines (Section 1.3.5) the following key bindings are active in the result viewer for this list:
- Sort files in increasing order
- [S], (ps . sort-up-key). Sorts according to selected column.
- Sort files in decreasing order
- [s], (ps . sort-down-key). Sorts according to selected column.
- Display directory
- RET. Opens a new viewer for the selected directory.
1.4 Customizing Commander S
On startup, Commander S reads the file ~/.cmdrsrc. The file
should contain an alist mapping configuration options to values. For
example:
(((main . switch-command-buffer-mode-key) . key-home) ((main . show-shell-key) . key-select))
1.5 Scheme commands
Commander S offers a subset of the commands provides by the command processor of Scheme 48 (or scsh). See Chapter 3 of the Scheme 48 manual for a detailed description of the following commands available in Commander S:
- in
- open
- user
- inspect
- The inspection happens in the result window and the user can use the arrow keys in addition to the u and d keys known from Scheme 48 to browse the value. There is currently no focus object in Commander S.
- reload-package
- exit
1.6 Contributing
We highly appreciate any kind of contribution to the Commander S project. To that end, we have set up a darcs repository at http://www-pu.informatik.uni-tuebingen.de/users/gasbichl/darcs/commander-s. Please send patches via e-mail to mailto:gasbichl@informatik.uni-tuebingen.de.