高齢者にとって「ダーク・カラーで動かすTerminal.app」は目が楽になる!問題は「directoryが濃い紫色で出力される」ので、殆どdirectoryがバックグラウンド・カラーに埋没して読めないのだ。
検索すると「LSCOLORS」と「LS_LOROS」の設定法が多数ある。zsh初心者としては、しっかりと整備したくなった。チュニーングをした結果、下の図1~3に示すように、「単純なlsの場合」でも「lsにTAB補完を施した場合」でも、概ね同じ出力で、視認性も良好だ。
図1 「/」
図2 「/dev」
図3 自作のサンプル・ディレクトリ
.zshrcの色設定の部分
########## start: Setup ls-color and it's completion color & prompt ##########
# 2015-04-20(月) 19:38:51
#========================
#
##---- Step 1/4) Colors at ls-command: $LSCOLORS #-----------------------------
# file type:DIlnSOpiexBDCDsusgTWOW
export LSCOLORS=EGFeFcHdxBDhGhAbAgxCxD
# •[a-hA-Hx]: cation! 'X(bright default)' not defined
# •example: fore/back=blue/cyan with normal font --> eg
# fore/back=blue/cyan with bold font ----> Eg | eG | EG
#----- Step 2/4) Colors at ls-completion: $LS_COLORS #--------------------------
#
LS_COLORS='di=1;34;46:ln=1;35;44:so=1;32;45:pi=1;33;39:ex=1;39;41:'
LS_COLORS=$LS_COLORS'bd=1;33;47:cd=1;36;47:su=1;30;41:sg=1;30;46:'
LS_COLORS=$LS_COLORS'tw=1;39;42:ow=1;39;43:st=1;7;39'
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
# in this command, '$ZLS_COLORS=$LS_COLORS'
#
##---- Step 3/4) Prompt: -------------------------------------------------------
# tune the preference of the terminal.app manually.
# -----» myTerminalColors2 «----- (2015-05-03(日) 12:39:41)
# Active Win. Inactive Win.
# # setting color R G B Opacity Blur Opacity Blur
# -----------------------------------------------------------------
# 01 Background 015 009 024 90 100 27 23
# 02 Text 230 230 230
# 03 BoldText 255 255 255
# 04 Selection 220 140 033
# --------------------------------------
# 05 Black(0) 000 000 000
# 06 brightBlack(8) 102 102 102
# - - - - - - - - - - - - - - - - - -
# 07 Red(1) 153 000 000
# 08 brightRed(9) 229 000 000
# - - - - - - - - - - - - - - - - - -
# 09 Green(2) 000 166 000
# 10 brigtGreen(10) 000 217 000
# - - - - - - - - - - - - - - - - - -
# 11 Yellow(3) 153 153 000
# 12 brigtYellow(11) 229 229 000
# - - - - - - - - - - - - - - - - - -
# 13 Blue(4) 000 000 178
# 14 brigtBlue(12) 000 000 255
# - - - - - - - - - - - - - - - - - -
# 15 Magenta(5) 199 000 209
# 16 brigtMagenta(13) 229 000 229
# - - - - - - - - - - - - - - - - - -
# 17 Cyan(6) 119 194 203
# 18 brigtCyan(14) 087 239 255
# - - - - - - - - - - - - - - - - - -
# 19 White(7) 191 191 191
# 20 brigtWhite(15) 229 229 229
# --------------------------------------
# 21 Cursor 255 000 255
# --------------------------------------
#
##---- Step 4/4) Prompt: -------------------------------------------------------
# 2014-11-08(土) 11:12:35
#------------------------
# %n=UserName, %m=MachineName, "%4~"='compact dir display'
#
export PROMPT='%B%F{cyan}%K{blue}%n@%m[%4~]%#%k%f%b '
export RPROMPT='%B%F{cyan}%K{blue}%D{%H:%M:%S}%k%f%b'
#
########## end: Setup ls-color and it's completion color & prompt #############
「LSCOLORS」と「LS_COLOROS」に関するノート
![]() |
| Note on LSCOLORS and LS_COLORS |
関連記事
____
この記事の履歴
- 開始 2015-05-09(土) 13:38:17
- 追加 2015-06-16(火) 14:02:25 関連記事




0 件のコメント:
コメントを投稿