什么是 Windows 终端?What is Windows Terminal?

Windows 终端是一个面向命令行工具和 shell(如命令提示符、PowerShell 和适用于 Linux 的 Windows 子系统 (WSL))用户的新式终端应用程序。Windows Terminal is a modern terminal application for users of command-line tools and shells like Command Prompt, PowerShell, and Windows Subsystem for Linux (WSL). 它的主要功能包括多个选项卡、窗格、Unicode 和 UTF-8 字符支持、GPU 加速文本呈现引擎,你还可用它来创建你自己的主题并自定义文本、颜色、背景和快捷方式。Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and the ability to create your own themes and customize text, colors, backgrounds, and shortcuts.

Windows 终端屏幕截图

备注

控制台、终端和 shell 之间有何区别?What's the difference between a console, a terminal, and a shell? 阅读 Scott Hanselman 的解释。Read Scott Hanselman's explanation.

支持多种命令行应用程序的多个配置文件Multiple profiles supporting a variety of command line applications

任何具有命令行接口的应用程序都可以在 Windows 终端中运行。Any application that has a command line interface can be run inside Windows Terminal. 这包括从 PowerShell 和命令提示符到 Azure Cloud Shell 和任何 WSL 分发(如 Ubuntu 或 Oh-My-Zsh)的所有应用程序。This includes everything from PowerShell and Command Prompt to Azure Cloud Shell and any WSL distribution such as Ubuntu or Oh-My-Zsh.

自定义方案和配置Customized schemes and configurations

可以将 Windows 终端配置为具有多种配色方案和设置。You can configure your Windows Terminal to have a variety of color schemes and settings. 若要了解如何创建自己的配色方案,请访问配色方案页面To learn how to make your own color scheme, visit the Color schemes page. 还可以在自定义终端库中查找自定义终端配置。You can also find custom Terminal configurations in the Custom terminal gallery.

自定义操作Custom actions

可在 Windows 终端中使用多种自定义命令,获得更加自然的体验。There are a variety of custom commands you can use in Windows Terminal to have it feel more natural to you. 如果不喜欢特定的键盘快捷方式,可以将其更改为你喜欢的方式。If you don't like a particular keyboard shortcut, you can change it to whatever you prefer.

例如,若要复制命令行中的文本,默认的快捷方式为 ctrl+shift+cFor example, the default shortcut to copy text from the command line is ctrl+shift+c. 你可以将其更改为 ctrl+1 或你喜欢的其他方式。You can change this to ctrl+1 or whatever you prefer. 要打开新的选项卡,默认快捷方式是 ctrl+t,但你可能想要将其更改为 ctrl+2To open a new tab, the default shortcut is ctrl+t, but maybe you want to change this to ctrl+2. 用于在打开的选项卡之间进行切换的默认快捷方式是 ctrl+tab,可以将这个快捷方式更改为 ctrl+-并改为用于创建新选项卡。The default shortcut to flip between the tabs you have open is ctrl+tab, this could be changed to ctrl+- and used to create a new tab instead.

可在操作页面上了解如何自定义快捷方式。You can learn about customizing shortcuts on the Actions page.

Unicode 和 UTF-8 字符支持Unicode and UTF-8 character support

Windows 终端可以显示 Unicode 和 UTF-8 字符,如各种语言的表情符号和字符。Windows Terminal can display Unicode and UTF-8 characters such as emoji and characters from a variety of languages.

GPU 加速文本呈现GPU accelerated text rendering

Windows 终端使用 GPU 来呈现其文本,从而提供比默认 Windows 命令行体验更好的性能。Windows Terminal uses the GPU to render its text, thus providing improved performance over the default Windows command line experience.

背景图像支持Background image support

可以在 Windows 终端窗口中显示背景图像和 gif。You can have background images and gifs inside your Windows Terminal window. 有关如何向配置文件添加背景图像的信息,请参阅配置文件设置页Information on how to add background images to your profile can be found on the Profile settings page.

命令行参数Command line arguments

可以使用命令行参数将 Windows 终端设置为在特定配置中启动。You can set Windows Terminal to launch in a specific configuration using command line arguments. 可以指定要在新选项卡中打开哪个配置文件、应选择哪个文件夹目录,指定使用拆分窗口窗格打开终端,并指定选择应专注于哪个选项卡。You can specify which profile to open in a new tab, which folder directory should be selected, open the terminal with split window panes, and choose which tab should be in focus.

例如,若要使用三个窗格从 PowerShell 打开 Windows 终端(左窗格运行命令提示符配置文件,右窗格拆分为两个,一个用于 PowerShell,另一个用于运行 WSL 的默认配置文件),请输入:For example, to open Windows Terminal from PowerShell with three panes, with the left pane running a Command Prompt profile and the right pane split between your PowerShell and your default profile running WSL, enter:

wt -p "Command Prompt" `; split-pane -p "Windows PowerShell" `; split-pane -H wsl.exe

了解如何在命令行参数页上设置命令行参数。Learn how to set up command-line arguments on the Command line arguments page.