See also Section 32.1, “Random Screen Access”.
Input through *TERMINAL-IO*
uses the GNU readline library.
Arrow keys can be used to move within the input history.
The TAB key completes the SYMBOL
name or
PATHNAME
that is being typed.
See readline user
manual for general details and
TAB key for CLISP-specific
extensions.
The GNU readline library is not used (even when
CLISP is linked against it) if the stdin
and stdout
do not both
refer to the same terminal.
This is determined by the function stdio_same_tty_p
in file src/stream.d
.
In some exotic cases, e.g., when running under gdb in
an rxvt window under Cygwin, this may be
determined incorrectly.
See also Section 33.4, “Advanced Readline and History Functionality”.
Linking against GNU readline. For CLISP to use GNU readline it has to be detected by the configure process.
If you run it as
$
./configure --with-readline
it will fail if it cannot find a valid modern GNU readline installation.
--without-readline
, it will not even try to
find GNU readline.--with-readline=default
) is to use GNU readline if
it is found and link CLISP without it otherwise.
You can find out whether GNU readline has been detected by running
$
grep HAVE_READLINE config.h
in your build directory.
EXT:WITH-KEYBOARD
*TERMINAL-IO*
is not the only stream that
communicates directly with the user: During execution of the body of a
(
form,
EXT:WITH-KEYBOARD
. body
)EXT:*KEYBOARD-INPUT*
is the STREAM
that reads the
keystrokes from the keyboard.
It returns every keystroke in detail as an SYS::INPUT-CHARACTER
with the
following slots (see Section 13.4.1, “Input Characters” for accessing them):
char
the CHARACTER
for standard keys
(accessed with CHARACTER
)
For non-standard keys CHARACTER
SIGNAL
s an ERROR
, use EXT:CHAR-KEY
:
(EXT:WITH-KEYBOARD
(LOOP
:forchar
= (READ-CHAR
EXT:*KEYBOARD-INPUT*
) :forkey
= (OR
(EXT:CHAR-KEY
char
) (CHARACTER
char
)) :do (LIST
char
key
)) :when (EQL
key
#\Space) :return (LIST
char
key
)))
key
the key name, for non-standard keys
(accessed with EXT:CHAR-KEY
):
bits
:HYPER
:SUPER
:CONTROL
:META
font
0
.
This keyboard input is not echoed on the screen. During execution of a
(
form, no input from
EXT:WITH-KEYBOARD
. body
)*TERMINAL-IO*
or any synonymous stream should be requested.
Since SYS::INPUT-CHARACTER
is not a subtype of
CHARACTER
, READ-LINE
on EXT:*KEYBOARD-INPUT*
is illegal.
These notes document CLISP version 2.49 | Last modified: 2010-07-07 |