1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

fish の color をリセットする

Last updated at Posted at 2021-04-04

fish_config color でセットしたものをリセットしたい。

以下に記載した方法は、リセットというか、(そもそもデフォルトの色設定を僕が覚えてないので分からないが)とにかく色設定を無くす方法です。そのつもりで読んでください。

コマンドが見つからなかったので、愚直にやった...

まず、色をセットするときにこんな情報が stdout に出てくる

$ fish_config color
Web config started at file:///var/folders/7g/jd09fyrj3tlc_4bby7464xm00000gn/T/web_confighvq20_xt.html
Hit ENTER to stop.
$ set -L
$ set -U fish_color_normal 575F66
$ set -U fish_color_command 55B4D4
$ set -U fish_color_quote 86B300
$ set -U fish_color_redirection A37ACC
$ set -U fish_color_end ED9366
$ set -U fish_color_error F51818
$ set -U fish_color_param 575F66
$ set -U fish_color_comment ABB0B6
$ set -U fish_color_match F07171
$ set -U fish_color_selection FF9940
$ set -U fish_color_search_match FF9940
$ set -U fish_color_history_current --bold
$ set -U fish_color_operator FF9940
$ set -U fish_color_escape 4CBF99
$ set -U fish_color_cwd 399EE6
$ set -U fish_color_cwd_root red
$ set -U fish_color_valid_path --underline
$ set -U fish_color_autosuggestion 8A9199
$ set -U fish_color_user brgreen
$ set -U fish_color_host normal
$ set -U fish_color_cancel -r
$ set -U fish_pager_color_completion normal
$ set -U fish_pager_color_description B3A06D yellow
$ set -U fish_pager_color_prefix white --bold --underline
$ set -U fish_pager_color_progress brwhite --background=cyan

これは .config/fish/fish_variables に設定が追記される。なので、これらの情報を削除してしまえばよいと思う。

適当にこの出力から変数部分だけを抜き取り tmp ファイルに保存。シェルが得意な人はこんなことしないで、もっとうまいことやれると思います。。。

$ cat tmp
fish_color_normal
fish_color_command
fish_color_quote
fish_color_redirection
fish_color_end
fish_color_error
fish_color_param
fish_color_comment
fish_color_match
fish_color_selection
fish_color_search_match
fish_color_history_current
fish_color_operator
fish_color_escape
fish_color_cwd
fish_color_cwd_root
fish_color_valid_path
fish_color_autosuggestion
fish_color_user
fish_color_host
fish_color_cancel
fish_pager_color_completion
fish_pager_color_description
fish_pager_color_prefix
fish_pager_color_progress

下のコマンドで消せました。

for i in (cat tmp); set -e $i; end
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?