git home / emma home
logo

mtm

Terminal Multiplexer. Emma's branch.
git clone https://git.y1.nz/archives/mtm.tar.gz
Files | Log | Refs

mtm.1


      1 .Dd $Mdocdate$
      2 .Dt MTM 1
      3 .Os
      4 .Sh NAME
      5 .Nm mtm
      6 .Nd a micro-terminal multiplexer
      7 .Sh SYNOPSIS
      8 .Nm
      9 .Op Fl T Ar HOST
     10 .Op Fl t Ar TERM
     11 .Op Fl c Ar CHARACTER
     12 .Sh DESCRIPTION
     13 .Nm
     14 is a terminal multiplexer,
     15 a program that allows multiple terminal sessions to run within a single
     16 (physical or virtual)
     17 terminal session.
     18 .Pp
     19 The options are
     20 .Bl -tag -width Ds
     21 .It Fl T Ar HOST
     22 Assume that the host terminal
     23 .Po
     24 i.e. the terminal under which
     25 .Nm
     26 is running
     27 .Pc
     28 is of type
     29 .Ar HOST "."
     30 By default,
     31 the contents of the
     32 .Ev TERM
     33 environment variable are used.
     34 .It Fl t Ar TERM
     35 Set the
     36 .Ev TERM
     37 environment variable within the mtm session to
     38 .Ar TERM "."
     39 By default, this is
     40 .Em "screen-bce" ","
     41 or
     42 .Em "screen-256color-bce"
     43 if
     44 .Nm
     45 detects that the host terminal supports 256 colors.
     46 Note that this default can be changed at compile time,
     47 and thus may differ in your installation.
     48 .It Fl c Ar CHARACTER
     49 Commands are prefixed using
     50 .Ar CHARACTER
     51 in combination with the
     52 .Dq control
     53 key.
     54 By default this is
     55 .Dq "g" "."
     56 Note that this default can be changed at compile time,
     57 and thus may differ in your installation.
     58 .El
     59 .Pp
     60 .Ss Usage
     61 .Nm
     62 divides the screen into multiple virtual terminals.
     63 Each virtual terminal is updated and accessed independently.
     64 At any given time,
     65 exactly one virtual terminal is
     66 .Dq focused ","
     67 meaning that it receives any typed characters.
     68 The currently-focused terminal is indicated by the location of the cursor.
     69 .Pp
     70 While running,
     71 the following keys are recognized as commands to
     72 .Nm
     73 when prefixed with the command character:
     74 .Bl -tag -width Ds
     75 .It Em "Up/Down/Right/Left Arrow"
     76 Select the terminal above/below/to the right of/to the left of the currently focused one.
     77 .It Em "c"
     78 Abandon the keychord sequence.
     79 .It Em "o"
     80 .Pq "the letter oh"
     81 Switch to the last-focused terminal.
     82 .It Em "h" "or" "v"
     83 Split the focused terminal in half and stack horizontally
     84 .Pq "for 'h'"
     85 or stack vertically
     86 .Pq "for 'v'" ";"
     87 the newly-created terminal will be focused.
     88 .It Em "w"
     89 Delete the currently focused terminal.
     90 .It Em "l"
     91 .Pq "the letter ell"
     92 Redraw the screen.
     93 .It Em "PgUp/PgDown/End"
     94 Scroll the terminal up/down/to the bottom.
     95 By default,
     96 .Nm
     97 stores up to 1000 lines of scrolling history.
     98 Note that if the screen is currently scrolled back
     99 .Pq "that is, the scrollback buffer is not at the bottom"
    100 these keys need not be prefixed with the command key.
    101 .Nm
    102 will also scroll to the bottom on user input.
    103 .El
    104 .Pp
    105 Note that these command keys can be changed at compile time,
    106 and therefore may be different for this installation of
    107 .Nm "."
    108 .Pp
    109 .Nm
    110 will exit when its last virtual terminal is closed.
    111 .Ss The Value of Fl t
    112 The terminal name passed to
    113 .Fl t
    114 does not change how
    115 .Nm
    116 interprets command sequences,
    117 but rather changes what kind of terminal
    118 .Nm
    119 claims to be.
    120 Safe bets for this value are
    121 .Bl -tag -width Ds
    122 .It mtm
    123 This is the terminal described by the
    124 .Pa mtm.ti
    125 .Xr terminfo 5
    126 description that shipped with
    127 .Nm "."
    128 It is not necessarily installed on your system,
    129 but if it is, it will tell
    130 .Xr terminfo 5
    131 -aware programs how to use all of the
    132 .Nm
    133 features.
    134 Note that there aren't any user-visible features added here,
    135 but
    136 .Nm
    137 supports some extra cursor-movement commands,
    138 and thus using this terminal type where available may result in slightly
    139 speedier screen updates.
    140 .It mtm-256color
    141 This is the same as the
    142 .Nm
    143 terminal type, but advertising 256-color support.
    144 This can be used if the
    145 .Nm
    146 .Xr terminfo 5
    147 description is installed and the host terminal supports 256 or more colors.
    148 .It screen-bce
    149 This is the default if 256-color support is not detected.
    150 It is widely supported and its description is installed by default on most systems.
    151 This is a good choice if the
    152 .Nm
    153 .Xr terminfo 5
    154 description is not installed everywhere you expect to use
    155 .Nm mtm "."
    156 .It screen-bce-256color
    157 This is the default if 256-color support is detected.
    158 The same advice given for
    159 .Em screen-bce
    160 above applies here too.
    161 .El
    162 .Ss The mtm Environment
    163 .Nm
    164 sets the
    165 .Ev MTM
    166 environment variable to its process ID
    167 .Po
    168 see
    169 .Xr getpid 2
    170 .Pc "."
    171 Programs can test for the presence of this variable to determine if they are
    172 running inside of a
    173 .Nm
    174 instance.
    175 .Sh ENVIRONMENT
    176 The following environment variables affect the operation of
    177 .Nm mtm ":"
    178 .Bl -tag -width Ds
    179 .It Ev TERM
    180 Names the hosting terminal's type.
    181 This can be overridden using the
    182 .Fl T
    183 option.
    184 .It Ev ESCDELAY
    185 This variable specifies the number of milliseconds
    186 .Nm
    187 will wait after seeing an escape character for a special character sequence to complete.
    188 By default this is 1000
    189 .Pq "one second" "."
    190 .It Ev LC_CTYPE Ev LC_ALL Ev LANG
    191 These variables are consulted to determine the encoding used for textual data.
    192 .It SHELL
    193 If set,
    194 .Nm
    195 will launch the program named by this command in new virtual terminals.
    196 If this is unset,
    197 .Nm
    198 will use the value of the
    199 .Dq "command interpreter"
    200 field of the password database
    201 .Po
    202 see
    203 .Xr passwd 5
    204 .Pc
    205 if available,
    206 and will finally fall back to
    207 .Pa "/bin/sh" "."
    208 .Sh SEE ALSO
    209 .Xr sh 1
    210 .Xr terminfo 5
    211 .Sh BUGS
    212 .Pp
    213 .Nm
    214 will attempt to fit all virtual terminals in the window at once.
    215 If many terminals are created and the containing window is shrunk too small,
    216 the display will be suboptimal.
    217 .Pp
    218 The only human language in which output is generated and in which documentation
    219 is available is English,
    220 regardless of the user's preferred language.

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.