package require twoShell
?1.0? two_shell
pathName ?options?
two_shell
is a fake shell widget used to run interactive applications.
It shows a fake prompt and fake command string. Only very limited terminal
emulation is done (bell and delete). Requires Expect.
two_shell
widget command takes all of the text(n)
commands and additionally the
following:
- pathName
run
UnixCommand ?-option value ...?- Execute the program UnixCommand. The option -dir will change the working directory according to the directory name given as parameter. If the option -fake is set use the string value to display as command. After this program has stopped and the option -aftercmd is given, its value will be evaluated as script. The -focus option, if set to 0, prevents the shell widget from setting the focus to itself.
- pathName
kill
- Stop any running command.
- pathName
runState
- Returns
1
if there is a running process and0
otherwise.- pathName
clear
- Delete current content of the window.
two_shell
command
takes all options of the text(n)
widget plus to following:
-prompt
string- Set the fake
prompt
to string.-destructivebs
TCL_BOOLEAN- If set to
TRUE
, all backspaces are destructive (the default). IfFALSE
, backspace characters only move the insertion cursor back (needed by trivial terminal emulation, e.g. for bash).
two_shell
may generate the following
virtual event:
- <<RunningOn>> and <<RunningOff>>
- Shell is currently running some program (On) or not (Off).
two_shell
uses tags to enable different
formatting for commands etc.:
command
- Command string (which may be a fake).
prompt
- Displayed fake prompt.
two_shell
widget's contents:
command
- Denotes the beginning of the current (last run) command.
two_shell
is
a modified (subclassed) Tk text(n)
widget. The Class for bindtags is TwoShellTerm.