mlterm

From ArchWiki

mlterm is a very fast low latency terminal emulator that has many unique features such as rendering variable width fonts, proper bidirectional support out of the box, a daemon mode, multiple XIM as well as true background transparency.

Installation

Install the mlterm-gitAUR package.

Configuration

Settings are stored permanently in plain text files under ~/.mlterm/.

Most are defined in ~/.mlterm/main

All settings can be set through command line options.

A GUI configuration wizard can be opened with Ctrl+RightMouse and assist in experimenting with different settings.

Padding

Padding can be enabled by setting the inner_border=value in the main configuration file ~.mlterm/main or using the --border=value option.

Fonts

Fonts are defined separately in two different files ~/.mlterm/aafont (monospace) and ~/.mlterm/vaafont (non-monospace).

ENCODING = FONT NAME, SIZE

Each encoding can use a different font. Check the man page for a complete list of encodings.

Mlterm is provided with a tool called mlfc that populates aafont with a list of Unicode blocks-Font pairs that can assist you further down with choosing which fonts to use for specific languages.

Using variable width fonts

mlterm can properly display variable width fonts. First, define them in .mlterm/vaafont

DEFAULT = Latin Modern Roman, 12

And enable the option in .mlterm/main

use_variable_column_width = true

Alternatively, you can pass it on the command line --varwidth or check the Variable column width option in the Font dialog of the configuration window. Antialiasing needs to be enabled otherwise it will fallback to monospace.

use_anti_alias = true

Depending on the font, adjust Screen size ratio against font size in order to fit the window to the new variable width of its cells. Use the --wscr percentage option or save it permanently in the main configuration file:

screen_width_ratio = percentage

Custom colors

You can define your custom colors in ~/.mlterm/color file with the following color names :

black=#48483e
red=#dc2566
green=#8fc029
yellow=#d4c96e
blue=#55bcce
magenta=#9358fe
cyan=#56b7a5
white=#acada1
hl_black=#76715e
hl_red=#fa2772
hl_green=#a7e22e
hl_yellow=#e7db75
hl_blue=#66d9ee
hl_magenta=#ae82ff
hl_cyan=#66efd5
hl_white=#cfd0c2

In addition, foreground and background color values need to be specified separately either with -f and -b arguments or permanently stored in .mlterm/main :

fg_color = #f1ebeb
bg_color = #272822

Values for the previous examples correspond to the .Xresources monokai color theme.[1]

Usage

You can access the backscroll mode to scroll the buffer by pressing Shift+Up or Shift+Prior keys or using the mouse wheel.

To enter buffer selection mode, press Ctrl+Shift+Return and use arrow keys to navigate. Begin and end your selection by pressing the space Space key. The selected text will be copied to your clipboard.

Both modes support vi movement using hjkl and u/d keys to navigate the screen.

Troubleshooting

Render CJK characters when using Xft

If you see empty glyph boxes when rendering CJK characters, that is because the font you are using does not support them, and unlike using cairo, mlterm with Xft does not look for a fallback fonts as an alternative (as explained by the author in GitHub issue#18).

If your default font does not support CJK glyphs, you can specify such font (such as Noto Sans Mono CJK JP) as a fallback font besides your default font in ~/.mlterm/aafont :

DEFAULT = Fantasque Sans Mono 12
ISO10646_UCS4_1_FULLWIDTH = Noto Sans Mono CJK JP 10

Render Arabic script in Xft

If your main font is not supporting Arabic unicode ranges, you can specifically instruct mlterm to use a font with proper support for Arabic characters (such as DejaVu Sans Mono) by providing an exhaustive list of all unicode ranges for the Arabic script :

U+10a60-10a7f = DejaVu Sans Mono, 10
U+10a80-10a9f = DejaVu Sans Mono, 10
U+600-6ffj    = DejaVu Sans Mono, 10
U+750-77f     = DejaVu Sans Mono, 10
U+8a0-8ff     = DejaVu Sans Mono, 10
U+1ee00-1eeff = DejaVu Sans Mono, 10 
U+10e60-10e7f = DejaVu Sans Mono, 10
U+fe70-feff   = DejaVu Sans Mono, 10
U+fb50-fdff   = DejaVu Sans Mono, 10

Arabic script rendering when using fixed width fonts

When entering in Arabic on a R-to-L line, proper rendering of ligatures might need a screen refresh when using fixed width fonts. One workaround is to enable the variable column width option and set your vaafont to the fixed width font. follow this issue on github.

See also

  • LWN.net article about terminal emulators
  • Typometer a tool to measure input latency