<Chapter Label="Console User Interface">
<Heading>Console User Interface</Heading>
HPC-GAP has a multi-threaded user interface to assist with the development and debugging of concurrent programs. This
user interface is enabled by default; to disable it, and use the single-threaded interface, GAP has to be started with
the <C>-S</C> option.
The console user interface provides the user with the option to control threads by commands prefixed with an exclamation
mark ("!"). Those commands are listed below.
<P/>
For ease of use, users only need to type as many letters of each commands so that it can be unambiguously selected.
Thus, the shell will recognize <C>!l</C> as an abbreviation for <C>!list</C>.
List all current threads that are interacting with the user. This does not list threads created with
<C>CreateThread()</C> that have not entered a break loop.
Hide output from the thread with the numerical identifier or name <C>id</C> when it is not the foreground thread. If
no thread is specified, make this the default behavior for future threads.
Show output from the thread with the numerical identifier or name <C>id</C> even when it is not the foreground thread.
If no thread is specified, make this the default behavior for future threads.
Set the prompt for the specified thread (or for all newly created threads if <C>*</C> was specified) to be
<C>string</C>. If the string contains the pattern <C>id</C>, it is replaced with the numerical id of the thread; if
it contains the pattern <C>name</C>, it is replaced with the name of the thread; if the thread has no name, the
numerical id is displayed instead.
Prefix the output from the specified thread (or for all newly created threads if <C>*</C> was specified) with
<C>string</C>. The same substitution rules as for the <C>!prompt</C> command apply.
Make the previous thread in numerical order the foreground thread.
</Subsection>
<Subsection Label="replay">
<Heading>!replay num [id]</Heading>
Display the last <C>num</C> lines of output of the specified thread. If no thread was specified, display the last
<C>num</C> lines of the current foreground thread.
</Subsection>
<Subsection Label="run">
<Heading>!run function string</Heading>
Calls the function with name <C>function</C>, passing it the single argument <C>string</C> as a GAP string.
</Subsection>
</Section>
<Section Label="GAP functions to access the Shell UI">
<Heading>GAP functions to access the Shell UI</Heading>
There are several functions to access the basic functionality of the shell user interface. Other than <Ref
Func="TextUIRegisterCommand"/>, they can only be called from within a registered command.
<P/>
Threads can be specified either by their numerical identifier or by their name (as a string). The empty string can be
used to specify the current foreground thread.
<Description>
Registers the command <C>!name</C> with the shell UI. It will call <func> with the rest of the command line passed
as a string argument when typed.
</Description>
</ManSection>
<Description>
Returns the name of the current foreground thread or <K>fail</K> if the current foreground thread has no name.
</Description>
</ManSection>
<Description>
Returns the last <A>count</A> lines of the thread specified by <A>id</A> (which can be a numerical identifier or a
name). Returns <K>fail</K> if there is no such thread.
</Description>
</ManSection>
<Description>
Creates a new shell thread. Here, <A>foreground</A> is a boolean variable specifying whether it should be made the new
foreground thread and <A>name</A> is the name of the thread. The empty string can be used to leave the thread without a
name.
</Description>
</ManSection>
<Description>
Run the command denoted by <A>command</A> as though a user had typed it. The command must not contain a newline
character.
</Description>
</ManSection>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.