mapchan(1M) mapchan(1M)
NAME
mapchan - display and configure terminal mapping
SYNOPSIS
mapchan [-o | -d] [channel] Format 1
mapchan -s [-f mapfile] [channel ...] Format 2
mapchan -sn [channel ...] Format 3
mapchan -sa [-f mapfile] Format 4
DESCRIPTION
The mapchan mechanism supports the mapping of characters input and
output on terminals. On the input side, single characters can be
mapped to other characters (1-to-1 mapping), and compose key sequences
and dead key sequences (see below) can be defined. On the output side,
single characters can be mapped to one or more characters (1-to-N map-
ping).
The mapchan mechanism is typically useful for supporting terminals
which have no compose or dead key sequences of their own or for con-
verting output characters to device-specific character sequences.
The mapchan command is used to display and configure the mapping table
of one or more terminals.
Displaying mapping tables (Format 1)
The mapchan command in its first form writes the mapping table of ter-
minal channel to standard output. If channel is not specified, mapchan
uses the terminal associated with standard input, standard output or
standard error.
channel can be given as an absolute path name or as a path name rela-
tive to the /dev directory (e.g. /dev/term/tty000 or term/tty000).
The mapping table is output in a form which can be used as an input
file (mapfile) for another mapchan call. The map file format is
described on the mapchan(4) manual page.
By default, non-alphanumeric characters in the mapping table output
are shown in hexadecimal. This can be changed with the following
options:
-o Non-alphanumeric characters are shown in octal. This option must
not be combined with any other options.
-d Non-alphanumeric characters are shown in decimal. This option
must not be combined with any other options.
Page 1 Reliant UNIX 5.44 Printed 11/98
mapchan(1M) mapchan(1M)
The /etc/default/mapchan configuration file
The /etc/default/mapchan configuration file defines assignments of
mapping tables to terminals. The mapchan command evaluates these
assignments when configuring terminals (see below).
An assignment in the configuration file consists of a single line
comprising the name of a terminal and the name of a map file. The name
of the terminal must begin in the first column of the line and the two
names must be separated by one or more blanks. Blank lines and lines
beginning with the # character are ignored.
The /etc/default/mapchan file will look something like this:
# Default assignment
term/tty013 mapfile1
term/tty300 mapfile2
The terminal and map file specifications may be either absolute or
relative. Relative terminal names are looked for in the /dev direc-
tory; relatively specified map files must reside in the
/usr/lib/mapchan directory.
An assignment without a map file specification is equivalent to disa-
bling the mapchan mechanism for the specified terminal.
Configuring mapping tables (Formats 2, 3 and 4)
The -f, -n and -a options of the mapchan command all have to be com-
bined with the -s option. There are various ways of specifying the
terminals and the map files.
If no terminals are specified as channel ... with the mapchan -s com-
mand, mapchan uses the terminal associated with standard input, stan-
dard output or standard error.
If the -f mapfile option is added to the mapchan -s command, the ter-
minals specified as channel ... are configured on the basis of the
mapping table defined in the given map file. The map file format is
described on the mapchan(4) manual page.
If mapchan -s is issued without the -f mapfile option, the mapchan
command uses the map files assigned to the specified terminals in the
/etc/default/mapchan configuration file.
Using the -n option instead of the -f mapfile option is equivalent to
specifying an empty mapping table, thereby disabling the mapchan
mechanism for the specified terminals.
Page 2 Reliant UNIX 5.44 Printed 11/98
mapchan(1M) mapchan(1M)
If the -s option is combined with the -a option, no terminals must be
specified. This form of the command causes all the terminals listed in
the /etc/default/mapchan configuration file to be configured, using
either the map file named with the -f option or the map files assigned
to the terminals in the configuration file. It is usually best for use
of the -a option to be restricted to the system administrator.
General
Ordinary users can only configure terminals of which they are the
owner; the system administrator is authorized to configure any termi-
nal.
The first time a terminal is opened, the mapchan mechanism is dis-
abled. Thus the mapchan setting of a terminal is not retained beyond
the end of a session.
A dead key sequence is a sequence of two keystrokes mapped to a single
character. The first character of a dead key sequence must be identi-
fied as a dead key in the mapping table. The characters usually
defined as dead keys are the diacritics. Thus the dead key sequence 'e
could be mapped to the character é.
A compose key sequence is a sequence of three keystrokes mapped to a
single character. A compose key sequence must always start with the
compose key defined in the mapping table.
Errors on input may have the following causes:
⊕ If the character combination (dead or compose key sequence) is not
defined in the map file, the characters are discarded.
⊕ If a dead key sequence is interrupted by a dead key, both charac-
ters are discarded.
⊕ If a dead key sequence is interrupted by the compose key, the dead
key is discarded and the compose sequence is evaluated.
⊕ If a compose sequence is interrupted by the compose key, then
- the first compose sequence is discarded
- the second compose sequence is evaluated
A compose key sequence may include dead key characters. These are then
treated as normal characters.
If the map file includes the keyword "beep", an audible signal will
sound in any of the above situations.
Page 3 Reliant UNIX 5.44 Printed 11/98
mapchan(1M) mapchan(1M)
NOTES
As the mapchan mechanism is implemented in the STREAMS module
ldterm(7), this STREAMS module must be pushed in the terminal inter-
face being configured.
If an invalid mapping table is set on a terminal, it will generally no
longer be possible to work on that terminal.
Input characters are always subjected to 1-to-1 mapping, even if they
are part of a dead or compose key sequence, except in the case of dead
keys used within compose key sequences.
The ISTRIP flag [see stty(1)] should not be set for a terminal to
which a mapping table has been applied, as it causes the eighth bit to
be stripped.
Note that configuration of the PC keyboard is done with the mapkey(1M)
utility.
FILES
/etc/default/mapchan
/usr/lib/mapchan/*
SEE ALSO
stty(1), mapkey(1M), mapchan(4), ascii(5), meta-ascii(5), keyboard(7)
[on RM400], ldterm(7).
Page 4 Reliant UNIX 5.44 Printed 11/98