本篇作為書籤用途,記錄網路上的 Windows Terminal 相關資訊
Windows Terminal 快速鍵
alt + shift + + 增加左右分割畫面
alt + shift + - 增加上下分割畫面
alt + ← 或 → 移動焦點至另一個分割畫面
WSL 設定
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 echo "poy ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/poysudo apt-get update && sudo apt-get upgradecurl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejscurl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get install -y nodejssudo apt-get install -y build-essentialsudo npm install -g npmnpm --version
WSL 設定 Z shell (zsh) 設定前可以先在 Windows 系統中安裝 Fira Code 和 Powerline 字型,Powerline 我選用 Ubuntu Mono 的版本。注意!請選擇 True Type 字型 (ttf) 進行安裝。
1 2 3 4 5 6 7 8 9 10 sudo apt-get install zshzsh --version chsh -s $(which zsh) sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh) "
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ZSH_THEME="agnoster" export TERM="xterm-256color" if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi eval "$(dircolors ~/.dircolors) " ;home clear echo -ne "Hello, $USER . Today is, " ; date
調整 ls 資料夾背景顏色 What causes this green background in ls output?
1 dircolors -p > ~/.dircolors
將下面這行
1 OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
修改成
1 OTHER_WRITABLE 30;41 # dir that is other-writable (o+w) and not sticky
套用變更
1 eval "$(dircolors ~/.dircolors) " ;
如果要之後都套用此設定,可以修改 ~/.bashrc 檔,在裡面執行 eval "$(dircolors ~/.dircolors)";,讓每次啟動時,自動套用設定。
WSL .bashrc 設定 原始的 .bashrc 有判斷如果家目錄下有 .bash_aliases,則會載入該檔案內的 aliases 設定,可以加入以下 aliases:
1 2 3 4 5 alias home='cd /mnt/c/Users/poypo/' alias cls=clearalias e.='explorer.exe .' alias gl='git log --oneline --all --graph --decorate $*' alias ll='ls -al --show-control-chars -F --color $*'
另外可以在 .bashrc 最後面加上下面的指令,讓啟動 WLS 後,會切換到 Windows 的家目錄,並清掉啟動過程中的訊息,然後顯示今天日期。
1 2 3 home clear echo -ne "Hello, $USER . Today is, " ; date
自訂快捷鍵 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 { "actions" : [ { "command" : "find" , "keys" : "ctrl+shift+f" } , { "command" : "paste" , "keys" : "ctrl+v" } , { "command" : { "action" : "copy" , "singleLine" : false } , "keys" : "ctrl+c" } , { "command" : { "action" : "closeTab" } , "keys" : "ctrl+w" } , { "command" : { "action" : "newTab" } , "keys" : "ctrl+t" } , { "command" : { "action" : "splitPane" , "split" : "auto" , "splitMode" : "duplicate" } , "keys" : "alt+shift+d" } ] , }
全域字型設定 在 profiles 底下的 defaults 屬性中,加入 font 屬性,設定字型名稱、大小、粗細。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "profiles" : { "defaults" : { "font" : { "face" : "Fira Code" , "size" : 10 , "weight" : "normal" } } , } }
Theme Scheme 修改 Windows Terminal 的終端機樣式,透過將下面的程式碼加到 profiles.json 中的 schemes 屬性,即可使用。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "background" : "#282C34" , "black" : "#282C34" , "blue" : "#268BD2" , "brightBlack" : "#5A6374" , "brightBlue" : "#268BD2" , "brightCyan" : "#2AA198" , "brightGreen" : "#98C379" , "brightPurple" : "#D33682" , "brightRed" : "#E06C75" , "brightWhite" : "#FDF6E3" , "brightYellow" : "#C19C00" , "cursorColor" : "#FFFFFF" , "cyan" : "#2AA198" , "foreground" : "#FDF6E3" , "green" : "#98C379" , "name" : "PoyChang Theme" , "purple" : "#D33682" , "red" : "#E06C75" , "selectionBackground" : "#FFFFFF" , "white" : "#EEE8D5" , "yellow" : "#C19C00" } ,
參考資料: