windows terminal + zsh下,如果访问windows的目录,因为权限是777,所以ls的时候,会出现绿底蓝字的情况,特别的辣眼睛,搜了无数博客终于解决,记录下来造福大家。
初始情况:
调整后:
调整方法如下:
1. cd ~ 2. dircolors -p > .dircolors 3. vim .dircolors 找到 OTHER_WRITABLE 34;42 修改为 OTHER_WRITABLE 34;01 4. vim .zshrc 编辑.zshrc,添加下面这段(是从.bashrc拷贝出来的) if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls=‘ls --color=auto‘ alias dir=‘dir --color=auto‘ alias vdir=‘vdir --color=auto‘ alias grep=‘grep --color=auto‘ alias fgrep=‘fgrep --color=auto‘ alias egrep=‘egrep --color=auto‘ fi 5. source .zshrc 搞定,修改方法找到了,举一反三,调整其他颜色都so easy!
额外分享下设置windows terminal的复制粘贴快捷键
alt+c 复制 alt+v粘贴 alt+w关闭...
"keybindings": [ {"command":"closeTab", "keys":["Ctrl+w"]}, {"command": "newTab", "keys":["Ctrl+t"]}, {"command": "toggleFullscreen", "keys":["Alt+x"]}, {"command":"closePane", "keys":["Alt+w"]}, {"command": {"action":"copy","singleLine":false}, "keys":["Alt+c"]}, {"command": {"action":"paste","singleLine":false}, "keys":["Alt+v"]} ]