いろいろやってみるにっき

てきとーに生きている奴の日記

古いエントリのサムネイル画像がリンク切れになってたりするけど、チマチマ修正中


Windows 10のWSLが見にくいので色を変える

WSL(Windows Subsystem for Linux)はとても便利なのだが、青とか赤の文字が見にくい。

 

通常Ubuntuをインストールするとこんな色合い。

f:id:shigeo-t:20181229102242p:plain

 

探してみると、MicrosoftGithubWindowsコンソールカラーツールを提供していることが分かった。

  Introducing the Windows Console Colortool – Windows Command Line Tools For Developers

 

Githubはこちら。ブックマーク1ユーザしかいなかったので、オレもブックマークして2ユーザ目。


上に「Color Tool October 2018」下に「Color Tool Initial Release」がある。今回はColor Tool October 2018を選んでみた。zipをダウンロードして解凍。

f:id:shigeo-t:20181229102848p:plain

 

このままColorTool.exeを実行しても何も起きない。cmd.exeで実行する。オプション無で実行するとこんな感じ。

C:\Users\Shigeo\Downloads\ColorTool>ColorTool.exe Usage:
colortool.exe [options]
ColorTool is a utility for helping to set the color palette of the Windows Console.
By default, applies the colors in the specified .itermcolors or .ini file to the current console window.
This does NOT save the properties automatically. For that, you'll need to open the properties sheet and hit "Ok".
Included should be a `schemes/` directory with a selection of schemes of both formats for examples.
Feel free to add your own preferred scheme to that directory.
Arguments:
: The name of a color scheme. ct will try to first load it as an .itermcolors color scheme.
If that fails, it will look for it as an .ini file color scheme.
Options:
-?, --help : Display this help message
-c, --current : Print the color table for the currently applied scheme
-q, --quiet : Don't print the color table after applying
-d, --defaults : Apply the scheme to only the defaults in the registry
-b, --both : Apply the scheme to both the current console and the defaults.
-x, --xterm : Set the colors using VT sequences. Used for setting the colors in WSL.
Only works in Windows versions >= 17048.
-s, --schemes : Displays all available schemes
-v, --version : Display the version number
-o, --output : output the current color table to an file (in .ini format)

Available importers:
INI File Parser
concfg Parser
iTerm Parser

Introducing the Windows Console Colortool – Windows Command Line Tools For Developers から引用。

Included Schemes
The colortool will work with any .itermcolors scheme. We have also included some useful themes inside of the schemes folder for the tool. This tool makes it easier for users to change their color scheme based on their accessibility needs, and we are excited to promote that by adding a color scheme called deuteranopia targeted towards users who have trouble distinguishing red and green. Here's a description of each:

  • campbell : The new default color scheme for Windows Console
  • campbell-legacy : The first iteration of the campbell scheme
  • cmd-legacy : The legacy defaults of the Windows Console
  • OneHalfDark : A dark vim-airline theme by Son A. Pham
  • OneHalfLight : A light vim-airline theme by Son A. Pham
  • solarized_dark : The dark version of a popular color scheme by Ethan Schoonover
  • solarized_light : The light version of a popular color scheme by Ethan Schoonover
  • deuteranopia : A color scheme targeted towards making red and green clearer to users with red green colorblindness, and deuteranopia.

campbellを選んでみたが色が変わらない。今のデフォルトなので当然。実行コマンドはこれ。

ColorTool.exe -d campbell

 

campbell-legacyはこんな色。

f:id:shigeo-t:20181229112137p:plain

 cmd-legacyはこんな色。

f:id:shigeo-t:20181229112239p:plain

 OneHalfDarkはこんな色。次を試す。

f:id:shigeo-t:20181229110201p:plain

 OneHalfLightはこんな色。OneHalfLightとOneHalfDarkの違いはなんだろう。

f:id:shigeo-t:20181229110427p:plain

solarized_darkはこんな感じ。うーん。

f:id:shigeo-t:20181229110541p:plain

solarized_lightはこんな感じ。薄色系バックはいいんだけど、もうちょっとエッジの効いた奴は無いのかよ。

f:id:shigeo-t:20181229110652p:plain

最後は deuteranopia。色覚異常者用で緑使ってないよというやつ。なんかこれはいいかも。

f:id:shigeo-t:20181229112424p:plain

 

と、全部試し終わってしまった。結局黒バックだとコマンドプロンプトと間違えることもあるので、solarized_lightにする。ちょっと色は調整するかも。

お時間あったら、他のエントリもクリックして頂ければ幸いです。