Terminal 生活
はじめに
普段の生活環境(?)であるターミナルの設定アレコレ.
Wayland に移行した後は WezTerm をメインで利用中. rxvt の設定も一応してあるけれど, 合成絵文字の幅の勘定は苦手な様で…
等幅フォントの選択
最近の好みは
- 欧文: Victor Mono
- 実際には Nerd Font の font-patcher を当てた版を利用中
- 和文: Migu 1M … なんだけれど, 気分によって↓変えていたり
- IBM Plex Sans JP や BIZ UDGothic なんかも良いのだけれど, はてさて.
- Victor Mono にマッチする他のフォントは何があるかなぁ.
- 絵文字:
- Wezterm では Noto Color Emoji
- rxvt では幅の勘定ができる絵文字が限られる.
現在は Twemoji Mozilla →fallback は Symbola, としているが, はてさて.
- なお Symbola はライセンスが変わり, Debian 的には non-free 扱いである. 残念
EAW 対応: ロケールの入れ替え
EAW については
などを参照.
以前は自分で修正ロケールを作成して利用していたけれど、 更新頻度と完成度から
に乗り換えた。
tmux もロケール見て幅を算出しているのだけれど,
何故か C, つまりは en_US.UTF-8 を見て幅を算出しているので
ja_JP.UTF-8 だけじゃなく en_US.UTF-8
のロケールも上記の修正ロケールに変更しておく.
Wezterm
WezTerm - Wez's Terminal Emulator
自分で build して /usr/local/bin あたりにインストールしておく.
設定は以下. Color Scheme は沢山ありすぎて結構迷う. Dracula (Official) か Aura (Goph) あたりかな?
local wezterm = require 'wezterm'
local config = {}
if wezterm.config_builder then
config = wezterm.config_builder()
end
-- default gui startup args
config.default_gui_startup_args = { "start", "--always-new-process" }
config.clean_exit_codes = { 130 }
-- font settings
config.font = wezterm.font_with_fallback {
-- ------------------------------------------------------------------------
-- a 0 7 69 :< >= <= -> <-
-- ------------------------------------------------------------------------
{ family = 'Victor Mono',
weight = 'Medium',
assume_emoji_presentation = false ,
-- リガチャの設定は↓の切り替えコマンドで行なう
-- harfbuzz_features = {
-- 'calt=0', -- 記号類の合字の無効化
-- -- 'liga=0', -- 文脈依存の合字
-- -- 'clig=0', -- 標準の合字
-- 'ss01', -- Single-storey a
-- 'ss02', -- Slashed zero, variant 1
-- -- 'ss03', -- Slashed zero, variant 2
-- -- 'ss04', -- Slashed zero, variant 3
-- -- 'ss05', -- Slashed zero, variant 4
-- 'ss06', -- Slashed seven
-- 'ss07', -- Straighter 6 and 9
-- -- 'ss08=0', -- More fishlike turbofish
-- },
},
-- ------------------------------------------------------------------------
-- Ⅰ,Ⅱと I, II の区別はつくか?
-- ①と⑳は?全角スペース は? 半角カタカナは?
-- ------------------------------------------------------------------------
{ family = 'Migu 1M',
assume_emoji_presentation = false
},
{ family = 'Symbols Nerd Font',
assume_emoji_presentation = false
},
{ family = 'Noto Color Emoji', scale = 0.8 },
}
-- ---------------------------------------------------------------------------
-- リガチャの ON/OFF を切り替えるトグル機能
-- - 現状は先頭に 'calt=0' があるかどうかで判定
-- - 切り替えているのは記号類の合字のみ
-- ---------------------------------------------------------------------------
local function toggle_ligatures(window, pane)
local liga = { 'calt=0', 'ss01', 'ss02', 'ss06', 'ss07' };
local overrides = window:get_config_overrides() or {}
if not overrides.harfbuzz_features
or overrides.harfbuzz_features[1] == 'calt=1' then
overrides.harfbuzz_features = liga
-- }
else
liga[1] = 'calt=1';
overrides.harfbuzz_features = liga
end
window:set_config_overrides(overrides)
end
wezterm.on("toggle-ligatures", toggle_ligatures)
-- キーボードショートカットの設定は↓
-- ---------------------------------------------------------------------------
config.bold_brightens_ansi_colors = 'BrightAndBold'
-- 文字幅
-- @see github.com/hamano/locale-eaw --
config.cell_widths = require 'eaw-console-wezterm'
config.adjust_window_size_when_changing_font_size = true
-- -- Victor Mono --
config.font_size = 13
config.cell_width = 0.85
config.line_height = 0.85
config.underline_position = -2
config.unicode_version = 15
-- config.allow_square_glyphs_to_overflow_width = "WhenFollowedBySpace"
config.allow_square_glyphs_to_overflow_width = "Always"
-- config.allow_square_glyphs_to_overflow_width = "Never"
config.treat_east_asian_ambiguous_width_as_wide = false
config.warn_about_missing_glyphs = false
-- config.front_end = "WebGpu"
config.enable_wayland = true
config.prefer_egl = true
config.mux_enable_ssh_agent = false
-- color settings
config.window_background_opacity = 0.95
config.text_background_opacity = 1
config.color_scheme = 'Dracula (Official)'
-- misc.
config.audible_bell = Disabled
config.window_close_confirmation = 'NeverPrompt'
config.enable_tab_bar = false
config.enable_scroll_bar = false
config.window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0
}
config.window_content_alignment = {
horizontal = 'Center',
vertical = 'Bottom',
}
-- gui, mux server
-- config.console.exit_behavior = 'CloseOnCleanExit'
config.disable_default_mouse_bindings = true
config.hide_mouse_cursor_when_typing = false
config.pane_focus_follows_mouse = true
-- リガチャの切り替えコマンド
-- key binding
config.disable_default_key_bindings = true
config.keys = {
-- copy
{
key = "C",
mods = "CTRL",
action = wezterm.action.CopyTo 'Clipboard'
-- sync clipboard and primary selection by GPaste
},
-- paste
{ key = 'V',
mods = 'CTRL',
action = wezterm.action.PasteFrom 'Clipboard'
},
-- fontsize: reset
{ key = '0',
mods = 'CTRL',
action = wezterm.action.ResetFontSize
},
-- fontsize: decrease
{ key = '-',
mods = 'CTRL',
action = wezterm.action.DecreaseFontSize
},
-- fontsize: increase
{ key = '+',
mods = 'CTRL|SHIFT',
action = wezterm.action.IncreaseFontSize
},
-- リガチャのトグル: とりあえず空いているので C-L に割り当て
{ key = 'L',
mods = 'CTRL|SHIFT',
action = wezterm.action.EmitEvent("toggle-ligatures")
},
}
-- OS specific::
-- x86_64-pc-windows-msvc - Windows
if wezterm.target_triple == 'x86_64-pc-windows-msvc' then
config.check_for_updates = false
config.font_size = 14
config.cell_width = 0.9
config.line_height = 0.95
config.window_background_opacity = 0.95
config.ssh_domains = {
{
name = 'WSL2:DebianCustom',
remote_address = '127.0.0.1',
default_prog = { 'zsh' },
assume_shell = 'Posix',
multiplexing = 'None',
},
}
config.default_domain = "WSL2:DebianCustom"
end
-- x86_64-apple-darwin - macOS (Intel)
if wezterm.target_triple == 'x86_64-apple-darwin' then
config.send_composed_key_when_left_alt_is_pressed = false
config.send_composed_key_when_right_alt_is_pressed = false
end
-- aarch64-apple-darwin - macOS (Apple Silicon)
if wezterm.target_triple == 'aarch64-apple-darwin' then
config.send_composed_key_when_left_alt_is_pressed = false
config.send_composed_key_when_right_alt_is_pressed = false
end
-- x86_64-unknown-linux-gnu - Linux
if wezterm.target_triple == 'x86_64-unknown-linux-gnu' then
config.window_decorations = "NONE"
config.use_ime = false
-- conifg.xim_im_name = 'fcitx'
end
return configrxvt
rxvt-unicode の patch 当て
rxvt で 24bit color を使いたいので, patch を当てている. 当てている patch の殆どは Arch から拝借
- 24-bit-color.patch - aur.git - AUR Package Repositories
- enable-wide-glyphs.patch - aur.git - AUR Package Repositories
- improve-font-rendering.patch - aur.git - AUR Package Repositories
- [PATCH] Fix emoji font support
やっていることは
- salsa のリポジトリを手元に clone
- patch を順番に quilt に取り込み
-
gbp dch -R --nmuしてからgit-buildpackage
Debian unstable にある 9.31-3 向けの patch は以下
設定
Wayland 環境でも /.Xdefaults に適宜設定しておけば OK.
! -*- mode: conf-xdefaults; coding: utf-8-unix -*-
!! Rxvt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
URxvt*skipBuiltinGlyphs: true
URxvt*allow_bold: true
URxvt*font: xft:Victor Mono NF:style=Medium:size=13,xft:Migu 1M:style=Regular:size=13,xft:Twemoji Mozilla:size=13:style=Regular,xft:Symbola:size=13:style=Regular
URxvt*boldfont: xft:Victor Mono NF:style=Bold:size=13,xft:Migu 1M:style=Bold:size=13,xft:Twemoji Mozilla:size=13:style=Regular,xft:Symbola:size=13:style=Regular
URxvt*italicfont: xft:Victor Mono NF:style=Italic:size=13,xft:Migu 1M:style=Italic:size=13,xft:Twemoji Mozilla:size=13:style=Regular,xft:Symbola:size=13:style=Regular
URxvt*bolditalicfont: xft:Victor Mono NF:style=BoldItalic:size=13,xft:Migu 1M:style=Bolditalic:size=13,xft:Twemoji Mozilla:size=13:style=Regular,xft:Symbola:size=13:style=Regular
URxvt*letterSpace: -2
URxvt*lineSpace: -2
! misc settings
URxvt*saveLines: 0
URxvt*scrollBar: false
URxvt*inputMethod: fcitx
! URxvt*inputMethod: xim
URxvt*preeditType: OnTheSpot
! URxvt*inputMethod: ibus
! URxvt*preeditType: OverTheSpot
URxvt*depth: 32
URxvt*fading: 30
URxvt*cursorBlink: false
URxvt*cursorUnderline: false
! Dracula color scheme
URxvt*cursorColor: #ffb86c
URxvt*cursorColor2: #242424
URxvt*foreground: #f8f8f2
URxvt*background: [90]#282A36
URxvt.color0: #21222c
URxvt.color1: #ff5555
URxvt.color2: #50fa7b
URxvt.color3: #f1fa8c
URxvt.color4: #bd93f9
URxvt.color5: #ff79c6
URxvt.color6: #8be9fd
URxvt.color7: #f8f8f2
URxvt.color8: #6272a4
URxvt.color9: #ff6e6e
URxvt.color10: #69ff94
URxvt.color11: #ffffa5
URxvt.color12: #d6acff
URxvt.color13: #ff92df
URxvt.color14: #a4ffff
URxvt.color15: #ffffff
! plugin
URxvt.perl-lib: /home/uwabami/.config/rxvt-ext
URxvt.perl-ext-common: default,clipboard,xim-onthespot,font-size
! URxvt.url-select.launcher: /usr/bin/xdg-open
! URxvt.url-select.button: 1
! URxvt.url-select.underline: false
URxvt.keysym.M-u: perl:url-select:select_next
URxvt.font-size.step: 1.5
URxvt.iso14755: false
URxvt.keysym.Shift-Control-C: perl:clipboard:copy
URxvt.keysym.Shift-Control-V: perl:clipboard:paste
URxvt.clipboard.copycmd: xclip -in -selection clipboard
URxvt.clipboard.pastecmd: xclip -out -selection clipboardtmux
設定は以下の通り.
# -*- mode: tmux; mode: rainbow; coding: utf-8-unix; indent-tabs-mode: nil -*-
#
# Author: Youhei SASAKI <uwabami@gfd-dennou.org>
# $Lastupdate: 2026-02-22 17:08:12$
# License: Public domain.
## general
# ESC での遅延解消: don't wait
set -sg escape-time 0
# Window, pane を 0 始まりに
set -g base-index 0
set -g pane-base-index 0
# mouse 操作を無効化
setw -g mouse off
# disable bell action
set -g bell-action none
# Window renmae enabled
setw -g automatic-rename on
# default で起動するコマンド: zsh
set -g default-command zsh
# prefix の有効時間: no wait
set-option -g repeat-time 0
# renumbering
set -g renumber-windows on
## display
# TERM等の設定
set-option -ga terminal-overrides ",rxvt*:Tc,xterm*:Tc,st*:Tc,kitty*:Tc,alacritty*:Tc,foot*:Tc"
set -as terminal-features ",alacritty:RGB,xterm-ghostty:RGB,foot:RGB,wezterm:RGB"
set-environment -g COLORTERM 24bit
set -g default-terminal "screen-256color"
# yazi - image preview
set -g allow-passthrough on
set -ga update-environment TERM
set -ga update-environment TERM_PROGRAM
# set -g default-terminal tmux-direct
set-environment -g NCURSES_NO_UTF8_ACS 0
# 罫線素片の扱い: rxvt, suckless-term はコレで良い.
set -ag terminal-overrides ',*:U8=0'
# メッセージ表示時間(既定値は1000?)
set -g display-time 4000
# 後方スクロール行数(既定値は2000)
set -g history-limit 8192
setw -g pane-active-border-style "fg=#ff5252,bg=default"
setw -g pane-border-style "fg=#64FCDA,bg=default"
# set -g pane-border-status bottom
# set -g pane-border-format " [ ###P #T ] "
# set -g pane-border-format "#{pane_index} #{pane_title}"
# don't show other activity
set -g monitor-activity off
set -g visual-activity off
set -g allow-rename on
# pane number display
# set -g display-panes-time 4000
set -g status-style "fg=#888888,bg=#000000"
# set -g status-interval 1
setw -g window-status-current-style "fg=#ff5252,bg=default"
setw -g message-style "fg=#242424,bg=#ffd740,bright"
setw -g status-left-length 25
setw -g status-right-length 15
setw -g status-left "#[fg=#4c4cff][#[fg=#f6f3e8]#h#[fg=#4c4cff]]#[default] "
setw -g status-right "#[fg=#4c4cff]|#[fg=#f6f3e8]#(date +%y/%m/%d)#[fg=#4c4cff]|#[default]"
setw -g pane-border-format ' #{=/-20/…:pane_title} [#{=/-20/…:pane_current_command}] #(pgrep -P "#{pane_pid}" | tr "\n" " ")#{pane_current_path} #{?alternate_on,<Alt Mode> ,}'
## keybind
# prefix:
unbind C-b # 既定のPrefixキー(Ctrl+b)の割り当てを解除
set -g prefix C-t # Ctrl+tをPrefixキーにする
bind C-t send-prefix # prefix-key の入力を渡す
# reload
bind r source-file ~/.config/tmux/tmux.conf \; display "Reload config file"
# コピーモードで vi + emacs 風
setw -g mode-keys vi
bind -T copy-mode-vi C-a send-keys -X start-of-line
bind -T copy-mode-vi C-e send-keys -X end-of-line
bind -T copy-mode-vi v send-keys -X begin-selection
set -s set-clipboard external
# bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard >/dev/null'
# bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel '/mnt/c/Windows/System32/clip.exe'
# bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel '~/bin/win32yank.exe -i'
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'wl-copy'
bind -T copy-mode-vi NPage send-keys -X page-down
bind -T copy-mode-vi PPage send-keys -X page-up
unbind ]
# bind ] run-shell "xclip -o -selection clipboard | tmux load-buffer - && tmux paste-buffer"
# bind ] run-shell "~/bin/win32yank.exe -o | tmux load-buffer - && tmux paste-buffer"
# bind ] run-shell "~/bin/win32yank.exe -o | tmux load-buffer - && tmux paste-buffer"
bind ] run-shell "wl-paste | tmux load-buffer - && tmux paste-buffer"
unbind %
unbind '"'
# bind-key z resize-pane -Z
unbind z
# bind-key C-z suspend-client
unbind C-z
unbind Z
unbind s
bind s split-window -v
unbind |
bind | split-window -h
unbind u
bind u run ~/.config/tmux/tmux-url-select.pl
# bind u run ~/.cargo/bin/tmux-hints
# bind u run /home/uwabami/Sources/Git/github.com/wfxr/tmux-fzf-url/fzf-url.sh
unbind C-c
bind C-c new-window
unbind C-p
bind C-p previous-window
unbind C-n
bind C-n next-window
## Custom command
unbind-key -
bind - run-shell ~/.config/tmux/weechat-toggle.sh
# unbind-key b
# bind-key b split-window 'tmux lsw | peco | cut -d":" -f 1 | xargs tmux select-window -t'
unbind C-Up
unbind C-Down
unbind C-Left
unbind C-Right
unbind M-Up
unbind M-Down
unbind M-Left
unbind M-Right
# tmux plugin manager
# set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.config/tmux/plugins'
# initialize
# run ~/.config/tmux/tpm/tpmObsolete
以下は最近やってないことなど. 一応残しておく.
OBSOLETE EAW 対応の修正ロケール
Obsolete もう更新してません.
手元の環境では East Asian Ambiguous Char と絵文字の文字幅を強制的に "2" とする 修正ロケールを使っている.
微妙に間違っている気もしないではないが, まあ良いか, 的な.
UNICODE の Box drawing char は "1" にした方が良いかなぁ…
OBSOLETE 自作合成フォント:
Obsolete 最近は更新してません.
「プログラミング」とか「等幅」とかで検索すると イロイロな合成フォントが見つかりますが, いまいち気にいるフォントが無かったので, 自作することにしました.
- uwabami/isfit-plus: Icon Symbols Font In Terminal plus
- uwabami/fsmrmp: FSMRMP - Patched Font: 'Fantasque Sans Mono' + 'Rounded Mgen+'
現状はとりあえずこれで良しとする感じ.
OBSOLETE rxvt-unicode の patch 当て
Obsolete 合成フォントを自作するようになったので最近はここまで凝ったことしてないです.
Debian では configure オプションの変えた urxvt のパッケージが提供されていた.
(256色が使いたいので rxvt-unicode-256color を使っていた).
最近はこれらは dummy になっていて, rxvt-unicode を入れれば良い模様
% apt-cache search rxvt-unicode aterm - dummy transitional package for rxvt-unicode aterm-ml - dummy transitional package for rxvt-unicode rxvt - dummy transitional package for rxvt-unicode rxvt-ml - dummy transitional package for rxvt-unicode rxvt-unicode - RXVT-like terminal emulator with Unicode and 256-color support rxvt-unicode-256color - dummy transitional package for rxvt-unicode rxvt-unicode-lite - dummy transitional package for rxvt-unicode
ただ, フォント表示に関して幾つか気になるところがある. 詳細はrxvt-unicodeのフォントレンダリングを改善する - emonkak's Blog
パッチは以下. これに Debian パッケージをこのパッチを当てて rebuild して使っている.
diff --git a/src/rxvtfont.C b/src/rxvtfont.C
index 1914539..4c0189e 100644
--- a/src/rxvtfont.C
+++ b/src/rxvtfont.C
@@ -1223,92 +1223,63 @@ rxvt_font_xft::load (const rxvt_fontprop &prop, bool force_prop)
return false;
int ftheight = 0;
- bool success = true;
-
- for (;;)
- {
- p = FcPatternDuplicate (match);
- f = XftFontOpenPattern (disp, p);
-
- if (!f)
- {
- FcPatternDestroy (p);
- success = false;
- break;
- }
-
- FT_Face face = XftLockFace (f);
-
- ascent = (face->size->metrics.ascender + 63) >> 6;
- descent = (-face->size->metrics.descender + 63) >> 6;
- height = max (ascent + descent, (face->size->metrics.height + 63) >> 6);
- width = 0;
-
- bool scalable = face->face_flags & FT_FACE_FLAG_SCALABLE;
- XftUnlockFace (f);
+ p = FcPatternDuplicate (match);
+ f = XftFontOpenPattern (disp, p);
- int glheight = height;
+ if (!f)
+ {
+ FcPatternDestroy (p);
+ return false;
+ }
- for (uint16_t *t = extent_test_chars; t < extent_test_chars + ecb_array_length (extent_test_chars); t++)
- {
- FcChar16 ch = *t;
+ FT_Face face = XftLockFace (f);
- if (cs != CS_UNICODE
- && ch > 0x100
- && FROM_UNICODE (cs, ch) == NOCHAR)
- continue;
+ ascent = f->ascent;
+ descent = f->descent;
+ height = max (ascent + descent, f->height);
+ width = 0;
- // ignore characters we wouldn't use anyways
- bool careful;
- if (!has_char (*t, &prop, careful))
- continue;
+ bool scalable = face->face_flags & FT_FACE_FLAG_SCALABLE;
- XGlyphInfo g;
- XftTextExtents16 (disp, f, &ch, 1, &g);
+ XftUnlockFace (f);
- g.width -= g.x;
+ for (uint16_t *t = extent_test_chars; t < extent_test_chars + ecb_array_length (extent_test_chars); t++)
+ {
+ FcChar16 ch = *t;
- int wcw = WCWIDTH (ch);
- if (wcw > 0) g.width = (g.width + wcw - 1) / wcw;
+ if (cs != CS_UNICODE
+ && ch > 0x100
+ && FROM_UNICODE (cs, ch) == NOCHAR)
+ continue;
- if (width < g.width ) width = g.width;
- if (height < g.height ) height = g.height;
- if (glheight < g.height - g.y) glheight = g.height - g.y;
- }
+ // ignore characters we wouldn't use anyways
+ bool careful;
+ if (!has_char (*t, &prop, careful))
+ continue;
- if (!width)
- {
- rxvt_warn ("unable to calculate font width for '%s', ignoring.\n", name);
+ XGlyphInfo g;
+ XftTextExtents16 (disp, f, &ch, 1, &g);
- XftFontClose (disp, f);
- f = 0;
+ g.width -= g.x;
- success = false;
- break;
- }
+ int wcw = WCWIDTH (ch);
+ if (wcw > 1) g.xOff = g.xOff / wcw;
- if (prop.height == rxvt_fontprop::unset
- || (height <= prop.height && glheight <= prop.height)
- || height <= 2
- || !scalable)
- break;
+ if (width < g.xOff ) width = g.xOff;
+ if (height < g.height) height = g.height;
+ }
- if (ftheight)
- {
- // take smaller steps near the end
- if (height > prop.height + 1) ftheight++;
- if (height > prop.height + 2) ftheight++;
- if (height > prop.height + 3) ftheight++;
+ bool success = true;
- ftheight -= height - prop.height;
- }
- else
- ftheight = prop.height - 1;
+ if (!width)
+ {
+ rxvt_warn ("unable to calculate font width for '%s', ignoring.\n", name);
XftFontClose (disp, f);
- FcPatternDel (match, FC_PIXEL_SIZE);
- FcPatternAddInteger (match, FC_PIXEL_SIZE, ftheight);
+ f = 0;
+
+ success = false;
}
FcPatternDestroy (match);
@@ -1395,7 +1366,7 @@ rxvt_font_xft::draw (rxvt_drawable &d, int x, int y,
ep->glyph = glyph;
ep->x = x_ + (cwidth - extents.xOff >> 1);
- ep->y = y_ + ascent;
+ ep->y = y_ + term->fbase + (term->lineSpace >> 1);
if (extents.xOff == 0)
ep->x = x_ + cwidth;
diff --git a/src/screen.C b/src/screen.C
index 9eb375a..7b3cdbf 100644
--- a/src/screen.C
+++ b/src/screen.C
@@ -2432,8 +2432,8 @@ rxvt_term::scr_refresh () NOTHROW
XSetForeground (dpy, gc, pix_colors[fore]);
XDrawLine (dpy, vt, gc,
- xpixel, ypixel + font->ascent + 1,
- xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1);
+ xpixel, ypixel + Height2Pixel (1) - 1,
+ xpixel + Width2Pixel (count) - 1, ypixel + Height2Pixel (1) - 1);
}
} /* for (col....) */
} /* for (row....) */
diff --git a/src/table/jis0208_1990_0.h b/src/table/jis0208_1990_0.h
index b23378f..0febcd3 100644
--- a/src/table/jis0208_1990_0.h
+++ b/src/table/jis0208_1990_0.h
@@ -2241,6 +2241,7 @@ const uint16_t *jis0208_1990_0_f_i[] = {
static uint32_t cs_jis0208_1990_0_from_unicode (unicode_t unicode) {
if (unicode == 0x2312) return 0x225e;
+ if (unicode == 0xff5e) return 0x2141;
uint8_t l = unicode;
uint16_t h = unicode >> 8;
if (0x00 <= h && h <= 0xffOBSOLETE tmux の EAW 対応 patch
Obsolete EAW対応としてロケールを入れ替えるようになったので, 最近は patch はあててないです.
tmux EAW 文字幅問題の扱いに多少(?)不満があるので, 以下二つのパッチを当てて rebuild して使っている.
一つ目は pane-border 等、全て ASCII で描くパッチ.
From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Sat, 4 Feb 2017 03:29:22 +0900
Subject: Use box drawing DECSP or ASCII with option 'pane-border-ascii'
Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
---
options-table.c | 5 +++++
tty-acs.c | 68 ++++++++++++++++++++++++++++-----------------------------
2 files changed, 39 insertions(+), 34 deletions(-)
--- a/options-table.c
+++ b/options-table.c
@@ -293,6 +293,12 @@
.default_num = 0
},
+ { .name = "pane-border-ascii",
+ .type = OPTIONS_TABLE_FLAG,
+ .scope = OPTIONS_TABLE_SESSION,
+ .default_num = 1
+ },
+
{ .name = "prefix",
.type = OPTIONS_TABLE_KEY,
.scope = OPTIONS_TABLE_SESSION,
--- a/tty-acs.c
+++ b/tty-acs.c
@@ -30,38 +30,38 @@
const char *string;
};
const struct tty_acs_entry tty_acs_table[] = {
- { '+', "\342\206\222" }, /* arrow pointing right */
- { ',', "\342\206\220" }, /* arrow pointing left */
- { '-', "\342\206\221" }, /* arrow pointing up */
- { '.', "\342\206\223" }, /* arrow pointing down */
- { '0', "\342\226\256" }, /* solid square block */
- { '`', "\342\227\206" }, /* diamond */
- { 'a', "\342\226\222" }, /* checker board (stipple) */
- { 'f', "\302\260" }, /* degree symbol */
- { 'g', "\302\261" }, /* plus/minus */
- { 'h', "\342\226\222" }, /* board of squares */
- { 'i', "\342\230\203" }, /* lantern symbol */
- { 'j', "\342\224\230" }, /* lower right corner */
- { 'k', "\342\224\220" }, /* upper right corner */
- { 'l', "\342\224\214" }, /* upper left corner */
- { 'm', "\342\224\224" }, /* lower left corner */
- { 'n', "\342\224\274" }, /* large plus or crossover */
- { 'o', "\342\216\272" }, /* scan line 1 */
- { 'p', "\342\216\273" }, /* scan line 3 */
- { 'q', "\342\224\200" }, /* horizontal line */
- { 'r', "\342\216\274" }, /* scan line 7 */
- { 's', "\342\216\275" }, /* scan line 9 */
- { 't', "\342\224\234" }, /* tee pointing right */
- { 'u', "\342\224\244" }, /* tee pointing left */
- { 'v', "\342\224\264" }, /* tee pointing up */
- { 'w', "\342\224\254" }, /* tee pointing down */
- { 'x', "\342\224\202" }, /* vertical line */
- { 'y', "\342\211\244" }, /* less-than-or-equal-to */
- { 'z', "\342\211\245" }, /* greater-than-or-equal-to */
- { '{', "\317\200" }, /* greek pi */
- { '|', "\342\211\240" }, /* not-equal */
- { '}', "\302\243" }, /* UK pound sign */
- { '~', "\302\267" } /* bullet */
+ { '+', ">" }, /* arrow pointing right */
+ { ',', "<" }, /* arrow pointing left */
+ { '-', "^" }, /* arrow pointing up */
+ { '.', "." }, /* arrow pointing down */
+ { '0', "#" }, /* solid square block */
+ { '`', "#" }, /* diamond */
+ { 'a', "#" }, /* checker board (stipple) */
+ { 'f', "#" }, /* degree symbol */
+ { 'g', "#" }, /* plus/minus */
+ { 'h', "#" }, /* board of squares */
+ { 'i', "#" }, /* lantern symbol */
+ { 'j', "+" }, /* lower right corner */
+ { 'k', "+" }, /* upper right corner */
+ { 'l', "+" }, /* upper left corner */
+ { 'm', "+" }, /* lower left corner */
+ { 'n', "+" }, /* large plus or crossover */
+ { 'o', "_" }, /* scan line 1 */
+ { 'p', "_" }, /* scan line 3 */
+ { 'q', "-" }, /* horizontal line */
+ { 'r', "_" }, /* scan line 7 */
+ { 's', "_" }, /* scan line 9 */
+ { 't', "+" }, /* tee pointing right */
+ { 'u', "+" }, /* tee pointing left */
+ { 'v', "+" }, /* tee pointing up */
+ { 'w', "+" }, /* tee pointing down */
+ { 'x', "|" }, /* vertical line */
+ { 'y', "#" }, /* less-than-or-equal-to */
+ { 'z', "#" }, /* greater-than-or-equal-to */
+ { '{', "#" }, /* greek pi */
+ { '|', "#" }, /* not-equal */
+ { '}', "#" }, /* UK pound sign */
+ { '~', "*" } /* bullet */
};
int
@@ -80,8 +80,8 @@
{
struct tty_acs_entry *entry;
- /* If not a UTF-8 terminal, use the ACS set. */
- if (tty != NULL && !(tty->flags & TTY_UTF8)) {
+ /* If pane-border-ascii */
+ if ( options_get_number(global_s_options, "pane-border-ascii") != 0 ) {
if (tty->term->acs[ch][0] == '\0')
return (NULL);
return (&tty->term->acs[ch][0]);
--- a/tty.c
+++ b/tty.c
@@ -58,7 +58,7 @@
void tty_default_colours(struct grid_cell *, const struct window_pane *);
#define tty_use_acs(tty) \
- (tty_term_has((tty)->term, TTYC_ACSC) && !((tty)->flags & TTY_UTF8))
+ (tty_term_has((tty)->term, TTYC_ACSC) && (options_get_number(global_s_options, "pane-border-ascii") != 0 ))
#define tty_pane_full_width(tty, ctx) \
((ctx)->xoff == 0 && screen_size_x((ctx)->wp->screen) >= (tty)->sx)
二つ目は en_US.UTF-8 決め打ちを止めるパッチ.
From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Sat, 4 Feb 2017 03:30:21 +0900
Subject: Unse locale as en_US.UTF-8
Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
---
tmux.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
--- a/tmux.c
+++ b/tmux.c
@@ -188,13 +188,11 @@
const char *s;
int opt, flags, keys;
- if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL) {
- if (setlocale(LC_CTYPE, "") == NULL)
- errx(1, "invalid LC_ALL, LC_CTYPE or LANG");
- s = nl_langinfo(CODESET);
- if (strcasecmp(s, "UTF-8") != 0 && strcasecmp(s, "UTF8") != 0)
- errx(1, "need UTF-8 locale (LC_CTYPE) but have %s", s);
- }
+ if (setlocale(LC_CTYPE, "") == NULL)
+ errx(1, "invalid LC_ALL, LC_CTYPE or LANG");
+ s = nl_langinfo(CODESET);
+ if (strcasecmp(s, "UTF-8") != 0 && strcasecmp(s, "UTF8") != 0)
+ errx(1, "need UTF-8 locale (LC_CTYPE) but have %s", s);
setlocale(LC_TIME, "");
tzset();
これらのパッチを当てた Debian パッケージを作成し,
tmux.conf にて set-option -g pane-border-ascii 0 を指定している.