「Mlterm」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(英語版から転載)
タグ: リダイレクト解消
1行目: 1行目:
  +
{{Lowercase title}}
#redirect[[アプリケーション一覧/ユーティリティ#ターミナルエミュレータ]]
 
  +
[[Category:ターミナルエミュレータ]]
  +
[[en:mlterm]]
  +
[https://github.com/arakiken/mlterm mlterm] is a very fast [https://lwn.net/Articles/751763/ 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 {{AUR|mlterm-git}} package.
  +
  +
== Configuration ==
  +
  +
Settings are stored permanently in plain text files under {{ic|~/.mlterm/}}.
  +
  +
Most are defined in {{ic|~/.mlterm/main}}
  +
  +
All settings can be set through command line options.
  +
  +
A GUI configuration wizard can be opened with {{ic|Ctrl+RightMouse}} and assist in experimenting with different settings.
  +
  +
=== Padding ===
  +
  +
Padding can be enabled by setting the {{ic|inner_border{{=}}value}} in the main configuration file {{ic|~.mlterm/main}} or using the {{ic|--border{{=}}value}} option.
  +
  +
=== Fonts ===
  +
  +
Fonts are defined separately in two different files {{ic|~/.mlterm/aafont}} (monospace) and {{ic|~/.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 {{ic|mlfc}} that populates {{ic|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 ====
  +
  +
{{ic|mlterm}} can properly display variable width fonts. First, define them in {{ic|.mlterm/vaafont}}
  +
DEFAULT = Latin Modern Roman, 12
  +
And enable the option in {{ic|.mlterm/main}}
  +
use_variable_column_width = true
  +
Alternatively, you can pass it on the command line {{ic|--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 {{ic|--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 {{ic|~/.mlterm/colors}} 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 {{ic|-f}} and {{ic|-b}} arguments or permanently stored in {{ic|.mlterm/main}} :
  +
  +
fg_color = #f1ebeb
  +
bg_color = #272822
  +
  +
Values for the previous examples correspond to the .Xresources ''monokai'' color theme.[https://github.com/janoamaral/Xresources-themes.git]
  +
  +
== Usage ==
  +
  +
You can access the backscroll mode to scroll the buffer by pressing {{ic|Shift+Up}} or {{ic|Shift+Prior}} keys or using the mouse wheel.
  +
  +
To enter buffer selection mode, press {{ic|Ctrl+Shift+Return}} and use arrow keys to navigate. Begin and end your selection by pressing the space {{ic|space}} key. The selected text will be copied to your clipboard.
  +
  +
Both modes support vi movement using {{ic|hjkl}} and {{ic|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 [https://github.com/arakiken/mlterm/issues/18#issuecomment-841337016 GitHub issue#18]).
  +
  +
If your default font does not support CJK glyphs, you can specify such font (such as {{ic|Noto Sans Mono CJK JP}}) as a fallback font besides your default font in {{ic|~/.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 [[Wikipedia:Arabic_script_in_Unicode|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 {{ic|variable column width}} option and set your vaafont to the fixed width font. [https://github.com/arakiken/mlterm/issues/52 follow this issue on github].
  +
  +
== See also ==
  +
  +
*[https://lwn.net/Articles/751763/ LWN.net] article about terminal emulators
  +
*[https://github.com/pavelfatin/typometer Typometer] a tool to measure input latency

2023年12月28日 (木) 23:26時点における版

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/colors 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