zsh自定义命令提示符_如何使用Microsoft的ColorTool自定义命令提示符的配色方案

zsh自定义命令提示符

zsh自定义命令提示符

Microsoft created a new console color scheme for Windows 10’s Fall Creators Update, but existing Windows systems won’t get it automatically. A new, official tool allows you to install this new color scheme and other ones for easy customization of your Command Prompt windows.

微软为Windows 10的Fall Creators Update创建了一个新的控制台配色方案,但是现有的Windows系统不会自动获得它。 新的官方工具允许您安装此新的配色方案和其他配色方案,以轻松自定义命令提示符窗口。

You can personalize the Command Prompt through its Properties window, but the below tool will quickly install good-looking color schemes, saving you the trouble of color-coordinating the Command Prompt yourself.

您可以通过其“属性”窗口个性化命令提示符,但是以下工具将快速安装美观的配色方案,从而省去了自己自行调整命令提示符的麻烦。

获取Windows控制台ColorTool (Get the Windows Console ColorTool)

This is an open-source tool hosted on Microsoft’s GitHub repository. You can download it from the project’s releases page.

这是托管在Microsoft的GitHub存储库上的开源工具。 您可以从项目的发行页面下载它。

Once you’ve downloaded it, extract the contents of the .zip file to a directory on your computer. Both the colortool.exe and schemes folder should be in the same directory.

下载后,将.zip文件的内容提取到计算机上的目录中。 colortool.exe和schemes文件夹都应该在同一目录中。

This tool works on all versions of Windows 10—not just the Fall Creators Update. It also works on Windows 7, but you’ll need to install Microsoft’s .NET Framework 4 package before running it.

该工具可在Windows 10的所有版本上使用,而不仅限于Fall Creators Update。 它也可以在Windows 7上运行,但是在运行它之前,您需要安装Microsoft的.NET Framework 4软件包。

<

<

如何更改窗口的配色方案 (How to Change a Window’s Color Scheme)

First, you’ll want to change to the directory containing the colortool command you just downloaded. Run the cd command followed by the path to the directory. If the path has spaces in it, you’ll need to enclose it in quotation marks.

首先,您需要转到包含刚刚下载的colortool命令的目录。 运行cd命令,然后运行目录路径。 如果路径中有空格,则需要将其用引号引起来。

cd C:\Users\Name\Directory

(For easier use, you may want to place the colortool.exe file and schemes folder in a directory in your PATH. You’d then be able to run the colortool command from the prompt without changing to its directory first.)

(为便于使用,您可能希望将colortool.exe文件和schemes文件夹放在PATH中的目录中。然后,您可以从提示符处运行colortool命令,而无需先更改其目录。)

To change the current window’s color scheme, run the following command:

要更改当前窗口的配色方案,请运行以下命令:

colortool name_of_scheme

Replace “name_of_scheme” with the name of a scheme file found in the schemes folder. For example, the new default color scheme is named “campbell” and the old scheme is named “cmd-legacy”. So, to install the new color scheme, you’d run:

将“ name_of_scheme”替换为在schemes文件夹中找到的方案文件的名称。 例如,新的默认配色方案命名为“ campbell”,而旧的配色方案命名为“ cmd-legacy”。 因此,要安装新的配色方案,请运行:

colortool campbell

After you run the command, you’ll need to right-click the Command Prompt’s title bar and select “Properties”.

运行命令后,需要右键单击命令提示符的标题栏,然后选择“属性”。

When the Properties window opens, immediately click “OK” to save the color change. You don’t actually need to change any settings in the Properties window.

当“属性”窗口打开时,立即单击“确定”以保存颜色更改。 实际上,您不需要在“属性”窗口中更改任何设置。

Yes, this is a little weird—but this is the way the Command Prompt works, so the colortool command can’t immediately change your color scheme without you opening the Properties window and saving the changes.

是的,这有点奇怪-但这是命令提示符的工作方式,因此colortool命令无法在不打开“属性”窗口并保存更改的情况下立即更改您的配色方案。

The included solarized_dark and solarized_light also look quite nice, while the deuteranopia color scheme is intended for to make red and green look more clear to users with deuteranopia (red-green color blindness). Feel free to experiment with them!

包含的solarized_dark和solarized_light看起来也很不错,而deuteranopia配色方案旨在使红色和绿色对deuteranopia(红绿色色盲)的用户更加清晰。 随时尝试使用它们!

如何更改默认配色方案 (How to Change the Default Color Scheme)

The above command will change the color scheme only for the current window. You’ll need a different command option to change the default color scheme the Command Prompt opens with.

上面的命令将仅更改当前窗口的配色方案。 您将需要一个不同的命令选项来更改命令提示符打开时使用的默认配色方案。

To change the Command Prompt’s default color scheme, run the following command:

要更改命令提示符的默认配色方案,请运行以下命令:

colortool -d name_of_scheme

To change both the default color scheme and the current window’s color scheme, run the following command:

要更改默认配色方案和当前窗口的配色方案,请运行以下命令:

colortool -b name_of_scheme

You will also need to open the Properties window and click “OK” after running these commands.

运行这些命令后,您还需要打开“属性”窗口并单击“确定”。

如何获得更多配色方案 (How to Get More Color Schemes)

You aren’t limited to just the handful of color schemes that come with this tool. You can download any color scheme in .itermcolors format, place it in the schemes directory, and then enable it by typing colortool followed by its name.

您不仅限于此工具随附的少数配色方案。 您可以下载.itermcolors格式的任何配色方案,将其放在schemes目录中,然后通过键入colortool和其名称来启用它。

Mike Griese, Microsoft employee and colortool developer, recommends using the iTerm2 Color Schemes repository to find and download new color schemes. Scroll down on the repository’s main page and you’ll see a long list of color scheme names and screenshots.

Microsoft员工和colortool开发人员Mike Griese建议使用iTerm2配色方案存储库查找和下载新的配色方案。 在存储库的主页上向下滚动,您会看到一长串的配色方案名称和屏幕截图。

Once you find one you like, click the “schemes” directory on the repository’s GitHub page and locate the .itermcolors file with that name. Click the file to view it.

找到喜欢的文件后,单击存储库的GitHub页面上的“ schemes”目录,然后找到具有该名称的.itermcolors文件。 单击该文件以查看它。

Click the “Raw” button on the page to view the raw .itermcolors file.

单击页面上的“原始”按钮以查看原始.itermcolors文件。

Right-click the page and select “Save As” to save the .itermcolors file.

右键单击页面,然后选择“另存为”以保存.itermcolors文件。

Save it to your schemes directory and ensure it has the .itermcolors file extension. Your web browser may give it a .txt file extension by default.

将其保存到您的schemes目录,并确保其具有.itermcolors文件扩展名。 您的网络浏览器可能默认为其提供.txt文件扩展名。

You can then enable it for the current window, set it as your default, or make both changes by running the appropriate colortool command:

然后,您可以为当前窗口启用它,将其设置为默认值,或者通过运行适当的colortool命令进行两项更改:

colortool name_of_scheme

colortool -d name_of_scheme

colortool -b name_of_scheme

As always, you will need to open the Properties window and click “OK” for your change to take effect.

与往常一样,您需要打开“属性”窗口,然后单击“确定”以使更改生效。

After the Fall Creators Update is released, new Windows 10 installations will use the “campbell” color scheme by default. Existing Windows installations will continue to use the legacy color scheme to minimize surprise changes, so the tool is the only way to get the new one—aside from reinstalling Windows.

在秋季创作者更新发布后,默认情况下,新安装的Windows 10将使用“ campbell”配色方案。 现有的Windows安装将继续使用旧的配色方案以最大程度地减少意外更改,因此该工具是除重新安装Windows之外唯一获得新颜色的方法。

翻译自: https://www.howtogeek.com/322432/how-to-customize-your-command-prompts-color-scheme-with-microsofts-colortool/

zsh自定义命令提示符

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值