LoginSignup
3
0

More than 3 years have passed since last update.

Hyper+bobthefish (powerline) でフォントがズレた時のメモ<Ubuntu 18.04>

Last updated at Posted at 2019-09-01

powerlineが使いたかった

Image from Gyazo

Hyper+Ubuntuの固有問題

みなさんも毎週末には環境構築を楽しんでいることでしょう。私も、今週はUbuntu 18.04なんてモダンなデスクトップ環境を構築し、「新しいターミナルやシェルを試してみよう」と思い立ったのです。

そんな私に訪れた不幸が冒頭の画像。流行りのElectron製ターミナルHyper(ver 3.0.2)を入れ、シェルをfishにして、勢いにまかせてoh-my-fish/theme-bobthefishを入れたところ、謎の隙間が現れました。

■塗りつぶしテキストに▶を重ねて表示しているだけなんですよね、Powerline。だから環境によってはずれちゃう。

「よーし、おじさんbug fixしちゃうぞー」

などとテンションを上げて挑もうとしたところ、開発機のmacOSでは隙間が現れない。英語で検索しても情報が出てこない。半分あきらめていましたが、なぜか解決しました。メモがわりに残しておきます。

環境

OS: Ubuntu 18.04.3 LTS
Hyper: 3.0.2
fish : 3.0.2
fisher : 3.2.9

解決

変更したのはhyperの設定ファイル($HOME/.hyper.js)の1行だけ

これを

.hyper.js
    backgroundColor: '#000',

こうする

.hyper.js
    backgroundColor: 'rgba(0,0,0,0.99)',

するとこうなる

Image from Gyazo

予想

rgba(0,0,0,1)にしたら隙間でてきちゃった。
プロンプトの表示位置の指定に、透明度を使って計算する処理があるのではないかと思います。透明度を少数型にしておかないと、どこかで1px計算がずれるのだと思う。ubutu(あるいはgnome系linux)の固有問題っぽい。

おまけ

画像の設定値など

config.fish
# fishのキーバインドをvi風に
fish_vi_key_bindings
# プロンプトにviのモードを表記
set -g theme_display_vi yes

# 日付を表示
set -g theme_display_date yes
set -g theme_date_format "+%F %H:%M"

# 実は使っているフォントはpowerlineではなくnerd
set -g theme_powerline_fonts no
set -g theme_nerd_fonts yes

# masterでもブランチ名を表示
set -g theme_display_git_master_branch yes

# コマンドの実行時間を表示
set -g theme_display_cmd_duration yes

# shellのタイトルバー表示をカスタマイズ
set -g theme_title_display_user no
set -g theme_title_display_process yes
set -g theme_title_display_path no

# exitステータスを表示
set -g theme_show_exit_status yes

# ■▶の色テーマを設定
set -g theme_color_scheme dracula

# カーソルは■▶の次の行。プロンプトの頭は$。ディレクトリ名は省略表示しない(0)
set -g theme_newline_cursor yes
set -g theme_newline_prompt '$ '
set -g fish_prompt_pwd_dir_length 0

.hyper.jsはフォントとbackgroundColor以外は初期値

.hyper.js
    fontFamily: '"mononoki Nerd Font Mono", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0