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