MTM(1)

πŸ“¦ version 1.2.1, in alpine 3.24, nixos 26.05, nixpkgs unstable

πŸ’… MTM(1) β€” micro-terminal multiplexer, bestie edition πŸ’…

🌸 NAME 🌸

Okay bestie, welcome to the General Commands Manual page for mtm β€” a micro-terminal multiplexer. That’s the whole name, no cap. 🫢

✨ SYNOPSIS ✨

mtm [-T HOST] [-t TERM] [-c CHARACTER]

πŸ’– DESCRIPTION πŸ’–

So like, mtm is a terminal multiplexer β€” literally a program that lets multiple terminal sessions run inside one single (physical or virtual) terminal session. Multiple terminals, one window, main character energy. πŸ‘‘

The options are:

  • -T HOST β€” assume the host terminal (i.e. the terminal under which mtm is running) is of type HOST. By default, the contents of the TERM environment variable are used.
  • -t TERM β€” set the TERM environment variable inside the mtm session to TERM. By default, this is screen-bce, or screen-256color-bce if mtm detects that the host terminal supports 256 colors. Heads up: this default can be changed at compile time, so it might differ in your installation. πŸŽ€
  • -c CHARACTER β€” commands are prefixed using CHARACTER in combination with the β€œcontrol” key. By default this is β€œg”. Also: this default can be changed at compile time, so your installation may differ. ✨

πŸŽ€ Usage πŸŽ€

mtm divides the screen into multiple virtual terminals. Each virtual terminal is updated and accessed independently. At any given time, exactly one virtual terminal is β€œfocused” β€” meaning it receives any typed characters. The currently-focused terminal is indicated by the location of the cursor. Cursor location is basically the focus ring, iykyk. πŸ’…

While running, the following keys are recognized as commands to mtm when prefixed with the command character:

  • Up/Down/Right/Left Arrow β€” select the terminal above/below/to the right of/to the left of the currently focused one.
  • o β€” (the letter oh) switch to the last-focused terminal.
  • h or v β€” split the focused terminal in half and stack horizontally (for 'h') or stack vertically (for 'v'); the newly-created terminal will be focused.
  • w β€” delete the currently focused terminal.
  • l β€” (the letter ell) redraw the screen.
  • PgUp/PgDown/End β€” scroll the terminal up/down/to the bottom. By default, mtm stores up to 1000 lines of scrolling history. Note that if the screen is currently scrolled back (that is, the scrollback buffer is not at the bottom), these keys need not be prefixed with the command key. mtm will also scroll to the bottom on user input. πŸŒ€

Note that these command keys can be changed at compile time, and therefore may be different for this installation of mtm.

mtm will exit when its last virtual terminal is closed.

πŸ¦‹ The Value of -t πŸ¦‹

The terminal name passed to -t does not change how mtm interprets command sequences β€” it changes what kind of terminal mtm claims to be. Safe bets for this value are:

  • mtm β€” this is the terminal described by the mtm.ti terminfo(5) description that shipped with mtm. It is not necessarily installed on your system, but if it is, it will tell terminfo(5)-aware programs how to use all of the mtm features. Note that there aren’t any user-visible features added here, but mtm supports some extra cursor-movement commands, and thus using this terminal type where available may result in slightly speedier screen updates. ⚑
  • mtm-256color β€” this is the same as the mtm terminal type, but advertising 256-color support. This can be used if the mtm terminfo(5) description is installed and the host terminal supports 256 or more colors. 🌈
  • 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 mtm terminfo(5) description is not installed everywhere you expect to use mtm.
  • screen-bce-256color β€” this is the default if 256-color support is detected. The same advice given for screen-bce above applies here too.

🧚 The mtm Environment 🧚

mtm sets the MTM environment variable to its process ID (see getpid(2)). Programs can test for the presence of this variable to determine if they are running inside of a mtm instance. It’s giving β€œare we in the multiplexer or not” realness. 🫧

🌈 ENVIRONMENT 🌈

The following environment variables affect the operation of mtm:

  • TERM β€” names the hosting terminal’s type. This can be overridden using the -T option.
  • ESCDELAY β€” this variable specifies the number of milliseconds mtm will wait after seeing an escape character for a special character sequence to complete. By default this is 1000 (one second). ⏳
  • LC_CTYPE LC_ALL LANG β€” these variables are consulted to determine the encoding used for textual data. 🧬
  • SHELL β€” if set, mtm will launch the program named by this command in new virtual terminals. If this is unset, mtm will use the value of the β€œcommand interpreter” field of the password database (see passwd(5)) if available, and will finally fall back to /bin/sh.

πŸ‘€ SEE ALSO πŸ‘€

sh(1) terminfo(5)

πŸ’€ BUGS πŸ’€

mtm 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. 😭 Not a slay, just a layout limitation.

The only human language in which output is generated and in which documentation is available is English, regardless of the user’s preferred language.


β€” shipped by Debian, dated $Mdocdate$, and this was MTM(1); now go multiplex something cute, bestie πŸ’–πŸ’…

πŸ“¦ where this page comes from