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 ?-fake string? ?-aftercmd cmdstring?- Execute the program UnixCommand. If the option -fake is set: use the string to display as command. After this program has stopped the cmdstring will be evaluated if set with the option -aftercmd.
- 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.