two_shell(n) manual page
Back to the Index
Table of Contents
two_shell - Fake shell widget with very limited terminal emulation
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.
The 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 and
0 otherwise.
- pathName
clear
- Delete current content of the window.
The 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). If FALSE,
backspace characters only move the insertion cursor back (needed by trivial
terminal emulation, e.g. for bash).
The two_shell may generate
the following virtual event:
- <<RunningOn>> and <<RunningOff>>
- Shell is currently
running some program (On) or not (Off).
The two_shell uses tags
to enable different formatting for commands etc.:
command
- Command string
(which may be a fake).
prompt
- Displayed fake prompt.
Marks are
used to highlight sections within the two_shell widget's contents:
command
- Denotes the beginning of the current (last run) command.
The
two_shell is a modified (subclassed) Tk text(n)
widget. The Class for bindtags
is TwoShellTerm.
There is no real terminal emulation... maybe have a
closer look at tkterm/term_expect/virterm from expect?
Frank J.
Leitner
frank@fjl.de
two_text(n)
, expect(n)
.
Table of Contents
Back to the Index