Windows 终端中的全局设置Global settings in Windows Terminal

无论配置文件设置如何,下面列出的属性都将影响整个终端窗口。The properties listed below affect the entire terminal window, regardless of the profile settings. 这些应放在 settings.json 文件的根目录下。These should be placed at the root of your settings.json file.

默认配置文件Default profile

若要设置打开的默认配置文件,方法是键入ctrl+shift+t,键入分配给 newTab 的键绑定,运行 wt new-tab(未指定配置文件),或者单击“+”图标。Set the default profile that opens by typing ctrl+shift+t, typing the key binding assigned to newTab, running wt new-tab without specifying a profile, or clicking the '+' icon.

属性名称: defaultProfileProperty name: defaultProfile

必要性: 必需Necessity: Required

接受: 字符串形式的 GUID 或配置文件名称Accepts: GUID or profile name as a string

默认值: PowerShell 的 GUIDDefault value: PowerShell's GUID

重要

只有在 Windows 终端预览中可以将该配置文件名用于 defaultProfileUsing the profile name for defaultProfile is only available in Windows Terminal Preview.



禁用动态配置文件Disable dynamic profiles

这会设置禁用哪些动态配置文件生成器,从而阻止它们在启动时将其配置文件添加到配置文件列表中。This sets which dynamic profile generators are disabled, preventing them from adding their profiles to the list of profiles on startup. 有关动态配置文件的信息,请访问动态配置文件页For information on dynamic profiles, visit the Dynamic profiles page.

属性名称: disabledProfileSourcesProperty name: disabledProfileSources

必要性: 可选Necessity: Optional

接受: 数组中的 "Windows.Terminal.Wsl""Windows.Terminal.Azure" 和/或 "Windows.Terminal.PowershellCore"Accepts: "Windows.Terminal.Wsl", "Windows.Terminal.Azure", and/or "Windows.Terminal.PowershellCore" inside an array

默认值: []Default value: []



深色/浅色主题Dark/Light theme

这将设置应用程序的主题。This sets the theme of the application. "system" 将使用与 Windows 相同的主题。"system" will use the same theme as Windows.

属性名称: themeProperty name: theme

必要性: 可选Necessity: Optional

接受: "system""dark""light"Accepts: "system", "dark", "light"

默认值: "system"Default value: "system"



选项卡设置Tab settings

始终显示选项卡Always show tabs

如果此项设置为 true,将始终显示选项卡。When this is set to true, tabs are always displayed. 如果此项设置为 false 并将 showTabsInTitlebar 设置为 true,则选项卡将始终显示在标题栏的下方。When it's set to false and showTabsInTitlebar is set to true, tabs are always displayed underneath the title bar. 如果此项设置为 false 并将 showTabsInTitlebar 设置为 false,则只有存在多个选项卡后,选项卡才会显示,方法是键入 ctrl+shift+t 或键入分配给 newTab 的键绑定。When this is set to false and showTabsInTitlebar is set to false, tabs only appear after more than one tab exists by typing ctrl+shift+t or by typing the key binding assigned to newTab. 请注意,更改此设置将需要启动新的终端实例。Note that changing this setting will require starting a new terminal instance.

属性名称: alwaysShowTabsProperty name: alwaysShowTabs

必要性: 可选Necessity: Optional

接受: truefalseAccepts: true, false

默认值: trueDefault value: true

Windows 终端始终显示选项卡

选项卡宽度模式Tab width mode

这将设置选项卡的宽度。This sets the width of the tabs. "equal" 使每个选项卡具有相同宽度。"equal" makes each tab the same width. "titleLength" 将每个选项卡调整为标题长度。"titleLength" sizes each tab to the length of its title. "compact" 会将每个非活动选项卡缩小到图标的宽度,从而为活动选项卡留出更多空间来显示其完整标题。"compact" will shrink every inactive tab to the width of the icon, leaving the active tab more space to display its full title.

属性名称: tabWidthModeProperty name: tabWidthMode

必要性: 可选Necessity: Optional

接受: "equal""titleLength""compact"Accepts: "equal", "titleLength", "compact"

默认值: "equal"Default value: "equal"

Windows 终端选项卡宽度模式

重要

设置 "compact" 仅在 Windows 终端预览中可用。The "compact" setting is only available in Windows Terminal Preview.

隐藏关闭所有选项卡弹出窗口Hide close all tabs popup

如果设置为 true,则关闭多个选项卡处于打开状态的窗口时,需要确认。When this is set to true, closing a window with multiple tabs open will require confirmation. 如果设置为 false,则关闭多个选项卡处于打开状态的窗口时,不需要确认。When it's set to false, closing a window with multiple tabs open will not require confirmation.

属性名称: confirmCloseAllTabsProperty name: confirmCloseAllTabs

必要性: 可选Necessity: Optional

接受: truefalseAccepts: true, false

默认值: trueDefault value: true

Windows 终端确认关闭所有选项卡



启动设置Launch settings

在计算机启动时启动(预览Launch on startup (Preview)

如果设置为 true,会在计算机启动时启动 Windows 终端。When set to true, this enables the launch of Windows Terminal at startup. 如果将其设置为 false,会禁用启动任务项。Setting this to false will disable the startup task entry. 注意:如果组织策略或用户操作禁用了 Windows 终端启动任务项,则此设置不起作用。Note: if the Windows Terminal startup task entry is disabled either by org policy or by user action this setting will have no effect.

属性名称: startOnUserLoginProperty name: startOnUserLogin

必要性: 可选Necessity: Optional

接受: truefalseAccepts: true, false

默认值: falseDefault value: false

重要

此功能仅在 Windows 终端预览中可用。This feature is only available in Windows Terminal Preview.

启动大小Launch size

这将定义终端在启动时将采用最大化、全屏还是窗口形式。This defines whether the terminal will launch as maximized, fullscreen, or in a window.

属性名称: launchModeProperty name: launchMode

必要性: 可选Necessity: Optional

接受: "default""maximized""fullscreen"Accepts: "default", "maximized", "fullscreen"

默认值: "default"Default value: "default"

重要

设置 "fullscreen" 仅在 Windows 终端预览中可用。The "fullscreen" setting is only available in Windows Terminal Preview.

启动位置Launch position

这将设置首次加载时窗口左上角的像素位置。This sets the pixel position of the top left corner of the window upon first load. 在具有多个显示器的系统上,这些坐标相对于主显示器的左上角。On a system with multiple displays, these coordinates are relative to the top left of the primary display. 如果未提供 X 或 Y 坐标,则终端将为该值使用系统默认值。If an X or Y coordinate is not provided, the terminal will use the system default for that value. 如果 launchMode 设置为 "maximized",则窗口将在由这些坐标指定的监视器上以最大化方式显示。If launchMode is set to "maximized", the window will be maximized on the monitor specified by those coordinates.

属性名称: initialPositionProperty name: initialPosition

必要性: 可选Necessity: Optional

接受: 采用以下格式的字符串形式的坐标:",""#,#""#,"",#"Accepts: Coordinates as a string in the following formats: ",", "#,#", "#,", ",#"

默认值: ","Default value: ","

首次启动时的列Columns on first launch

这是首次加载时窗口中显示的字符列数。This is the number of character columns displayed in the window upon first load. 如果将 launchMode 设置为 "maximized",将忽略此属性。If launchMode is set to "maximized", this property is ignored.

属性名称: initialColsProperty name: initialCols

必要性: 可选Necessity: Optional

接受: 整数Accepts: Integer

默认值: 120Default value: 120

首次启动时的行Rows on first launch

这是首次加载时窗口中显示的行数。This is the number of rows displayed in the window upon first load. 如果将 launchMode 设置为 "maximized",将忽略此属性。If launchMode is set to "maximized", this property is ignored.

属性名称: initialRowsProperty name: initialRows

必要性: 可选Necessity: Optional

接受: 整数Accepts: Integer

默认值: 30Default value: 30



标题栏设置Title bar settings

显示/隐藏标题栏Show/Hide the title bar

如果设置为 true,则选项卡将移动到标题栏中,并且标题栏将消失。When this is set to true, the tabs are moved into the title bar and the title bar disappears. 如果设置为 false,则标题栏位于选项卡上方。When it's set to false, the title bar sits above the tabs. 请注意,更改此设置将需要启动新的终端实例。Note that changing this setting will require starting a new terminal instance.

属性名称: showTabsInTitlebarProperty name: showTabsInTitlebar

必要性: 可选Necessity: Optional

接受: truefalseAccepts: true, false

默认值: trueDefault value: true

Windows 终端在标题栏中显示选项卡

设置标题栏中的文本Set the text in the title bar

如果设置为 true,标题栏将显示所选选项卡的标题。如果设置为 false,标题栏将显示“Windows 终端”。When this is set to true, the title bar displays the title of the selected tab. When it's set to false, title bar displays "Windows Terminal". 请注意,更改此设置将需要启动新的终端实例。Note that changing this setting will require starting a new terminal instance.

属性名称: showTerminalTitleInTitlebarProperty name: showTerminalTitleInTitlebar

必要性: 可选Necessity: Optional

接受: truefalseAccepts: true, false

默认值: trueDefault value: true



所选内容设置Selection settings

选择内容后复制Copy after selection is made

如果设置为 true,则在创建时,所选内容会立即复制到剪贴板。When this is set to true, a selection is immediately copied to your clipboard upon creation. 在这种情况下,右键单击鼠标将始终执行粘贴操作。The right-click on your mouse will always paste in this case. 如果设置为 false,则选择内容后将保留,并等待进一步的操作。When it's set to false, the selection persists and awaits further action. 使用鼠标右键单击将复制所选内容。Using your mouse to right-click will copy the selection.

属性名称: copyOnSelectProperty name: copyOnSelect

必要性: 可选Necessity: Optional

接受: truefalseAccepts: true, false

默认值: falseDefault value: false

复制格式Copy formatting

如果设置为 true,则所选文本的颜色和字体格式也将复制到剪贴板。When this is set to true, the color and font formatting of selected text is also copied to your clipboard. 如果设置为 false,则只会将纯文本复制到剪贴板。When it's set to false, only plain text is copied to your clipboard.

属性名称: copyFormattingProperty name: copyFormatting

必要性: 可选Necessity: Optional

接受: truefalseAccepts: true, false

默认值: falseDefault value: false

字分隔符Word delimiters

这会确定双击选定的内容中使用的字分隔符。This determines the word delimiters used in a double-click selection. 字分隔符是指定两个字之间的边界的字符。Word delimiters are characters that specify where the boundary is between two words. 最常见的示例包括空格、分号、逗号和句号。The most common examples are spaces, semicolons, commas, and periods.

属性名称: wordDelimitersProperty name: wordDelimiters

必要性: 可选Necessity: Optional

接受: 字符串形式的字符Accepts: Characters as a string

默认值:  /\()"'-:,.;<>~!@#$%^&*|+=[]{}~?│Default value:  /\()"'-:,.;<>~!@#$%^&*|+=[]{}~?│
U+2502 BOX DRAWINGS LIGHT VERTICAL( is U+2502 BOX DRAWINGS LIGHT VERTICAL)



滚动速度Scroll speed

这是滚动鼠标滚轮一次滚动的行数。This is the number of rows to scroll at a time with the mouse wheel. 如果值不为零或 "system",这将替代系统设置。This will override the system setting if the value is not zero or "system".

属性名称: rowsToScrollProperty name: rowsToScroll

必要性: 可选Necessity: Optional

接受: 整数Accepts: Integer

默认值: "system"Default value: "system"



窗口大小调整行为Window resize behavior

如果设置为 true,则在调整大小时,该窗口将与最接近的字符边界对齐。When this is set to true, the window will snap to the nearest character boundary on resize. 如果设置为 false,则窗口大小会“平滑”调整。When it's set to false, the window will resize "smoothly".

属性名称: snapToGridOnResizeProperty name: snapToGridOnResize

必要性: 可选Necessity: Optional

接受: truefalseAccepts: true, false

默认值: trueDefault value: true

调整大小时 Windows 终端对齐网格



“渲染”设置Rendering settings

如果考虑更改渲染设置,可参阅故障排除页,获取更多信息来帮助自己设置。If you are thinking about changing the rendering settings, additional information is provided on the Troubleshooting page to help guide you.

屏幕重绘Screen redrawing

如果此项设置为 true,终端将重绘整个屏幕的每个帧。When this set to true, the terminal will redraw the entire screen each frame. 如果设置为 false,只会渲染屏幕中发生了变化的帧。When set to false, it will render only the updates to the screen between frames.

属性名称: experimental.rendering.forceFullRepaintProperty name: experimental.rendering.forceFullRepaint

必要性: 可选Necessity: Optional

接受: truefalseAccepts: true, false

默认值: falseDefault value: false

软件渲染Software rendering

如果此项设置为 true,终端将使用软件呈现器(也称为When this is set to true, the terminal will use the software renderer (a.k.a. WARP),而不是硬件呈现器。WARP) instead of the hardware one.

属性名称: experimental.rendering.softwareProperty name: experimental.rendering.software

必要性: 可选Necessity: Optional

接受: truefalseAccepts: true, false

默认值: falseDefault value: false