diff --git a/TerminalDocs/TOC.yml b/TerminalDocs/TOC.yml index ef718a1d..1a875a9e 100644 --- a/TerminalDocs/TOC.yml +++ b/TerminalDocs/TOC.yml @@ -16,14 +16,14 @@ href: customize-settings/color-schemes.md - name: Rendering href: customize-settings/rendering.md + - name: Actions + href: customize-settings/actions.md - name: Profile - General href: customize-settings/profile-general.md - name: Profile - Appearance href: customize-settings/profile-appearance.md - name: Profile - Advanced href: customize-settings/profile-advanced.md - - name: Actions - href: customize-settings/actions.md - name: Command line arguments href: command-line-arguments.md - name: Command palette @@ -34,6 +34,8 @@ href: panes.md - name: Dynamic profiles href: dynamic-profiles.md + - name: JSON fragment extensions + href: json-fragment-extensions.md - name: Cascadia Code href: cascadia-code.md - name: Tips and tricks diff --git a/TerminalDocs/command-line-arguments.md b/TerminalDocs/command-line-arguments.md index 593e5695..916d084a 100644 --- a/TerminalDocs/command-line-arguments.md +++ b/TerminalDocs/command-line-arguments.md @@ -1,20 +1,20 @@ --- -title: Windows Terminal command-line arguments -description: Learn how to create command-line arguments for Windows Terminal. +title: Windows Terminal command line arguments +description: Learn how to create command line arguments for Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 1/28/2021 +ms.date: 02/25/2021 ms.topic: how-to --- -# Using command-line arguments for Windows Terminal +# Using command line arguments for Windows Terminal You can use `wt.exe` to open a new instance of Windows Terminal from the command line. You can also use the execution alias `wt` instead. > [!NOTE] > If you built Windows Terminal from the source code on [GitHub](https://github.com/microsoft/terminal), you can open that build using `wtd.exe` or `wtd`. -![Windows Terminal command-line argument for split panes](./images/terminal-command-args.gif) +![Windows Terminal command line argument for split panes](./images/terminal-command-args.gif) ## Command line syntax @@ -24,7 +24,7 @@ The `wt` command line accepts two types of values: **options** and **commands**. wt [options] [command ; ] ``` -To display a help message listing the available command-line arguments, enter: `wt -h`, `wt --help`, `wt -?`, or `wt /?`. +To display a help message listing the available command line arguments, enter: `wt -h`, `wt --help`, `wt -?`, or `wt /?`. ## Options and commands @@ -36,6 +36,7 @@ Below is the full list of supported commands and options for the `wt` command li | `--maximized`, `-M` | Launches the terminal maximized. | | `--fullscreen`, `-F` | Launches the terminal as full screen. | | `--focus`, `-f` | Launches the terminal in the focus mode. Can be combined with `maximized`. | +| `--window`, `-w` `` | Launches the terminal in a specific window. | | Command | Parameters | Description | | ------- | ---------- | ----------- | @@ -44,9 +45,6 @@ Below is the full list of supported commands and options for the `wt` command li | `focus-tab`, `ft` | `--target, -t tab-index` | Focuses on a specific tab. | | `move-focus`, `mf` | `direction` | Move focus between panes in the given direction. Accepts one of `up`, `down`, `left`, `right`. | -> [!IMPORTANT] -> The `--tabColor` parameter of the `new-tab` subcommand, `--tabColor` and `--size,-s size` parameters of the `split-pane` subcommand, and the `move-focus` subcommand are only available in [Windows Terminal Preview](https://aka.ms/terminal-preview/). - > [!NOTE] > When opening Windows Terminal from cmd (Command Prompt), if you want to use your custom "cmd" profile settings, you will need to use the command `wt -p cmd`. Otherwise, to run your *default* profile settings, just use `wt cmd`. @@ -54,6 +52,55 @@ Below is the full list of supported commands and options for the `wt` command li Commands may vary slightly depending on which command line you're using. +### Target a specific window + +Below are examples of how to target specific windows using the `--window,-w` option. + + +#### [Command Prompt](#tab/windows) + +```cmd +// Open a new tab with the default profile in the current window +wt -w 0 nt + +// Open a new tab in a new window with the default profile +wt -w -1 nt + +// Open a new tab in the first-created terminal window with the default profile +wt -w 1 nt +``` + +#### [PowerShell](#tab/powershell) + +```powershell +// Open a new tab with the default profile in the current window +wt -w 0 nt + +// Open a new tab in a new window with the default profile +wt -w -1 nt + +// Open a new tab in the first-created terminal window with the default profile +wt -w 1 nt +``` + +#### [Linux](#tab/linux) + +```bash +// Open a new tab with the default profile in the current window +cmd.exe /c "wt.exe" -w 0 nt + +// Open a new tab in a new window with the default profile +cmd.exe /c "wt.exe" -w -1 nt + +// Open a new tab in the first-created terminal window with the default profile +cmd.exe /c "wt.exe" -w 1 nt +``` + +Execution aliases do not work in WSL distributions. If you want to use wt.exe from a WSL command line, you can spawn it from CMD directly by running `cmd.exe`. The `/c` option tells CMD to terminate after running. + +--- + + ### Open a new profile instance To open a new terminal instance, in this case the command will open the profile named "Ubuntu-18.04", enter: @@ -82,7 +129,7 @@ Execution aliases do not work in WSL distributions. If you want to use wt.exe fr --- - The `-p` flag is used to specify the Windows Terminal profile that should be opened. Substitute "Ubuntu-18.04" with the name of any terminal profile that you have installed. This will always open a new window. Windows Terminal is not yet capable of opening new tabs or panes in an existing instance. +The `-p` flag is used to specify the Windows Terminal profile that should be opened. Substitute "Ubuntu-18.04" with the name of any terminal profile that you have installed. This will always open a new window. Windows Terminal is not yet capable of opening new tabs or panes in an existing instance. ### Target a directory @@ -260,7 +307,7 @@ Execution aliases do not work in WSL distributions. If you want to use wt.exe fr --- -### Tab color ([Preview](https://aka.ms/terminal-preview)) +### Tab color To open a new terminal instance with custom tab colors, use the `--tabColor` argument. This argument overrides the value defined in the profile, but can be overridden as well using the tab color picker. In the following example, a new terminal is created with two tabs of different colors: @@ -294,9 +341,6 @@ When `--tabColor` is set for a tab, it is associated with the first pane of this wt new-tab --tabColor #009999 ; split-pane --tabColor #f59218 ``` -> [!IMPORTANT] -> This feature is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). - ### Tab focus To open a new terminal instance with a specific tab in focus, use the `-t` flag (or `--target`), along with the tab-index number. To open your default profile in the first tab and the "Ubuntu-18.04" profile focused in the second tab (`-t 1`), enter: diff --git a/TerminalDocs/command-palette.md b/TerminalDocs/command-palette.md index 7736df5a..0e0d5da0 100644 --- a/TerminalDocs/command-palette.md +++ b/TerminalDocs/command-palette.md @@ -1,9 +1,9 @@ --- title: Windows Terminal Command Palette -description: Learn how to use the command palette in the Windows Terminal. +description: Learn how to use the command palette in Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 1/28/2021 +ms.date: 02/25/2021 ms.topic: how-to ms.localizationpriority: high --- @@ -32,9 +32,6 @@ You can add a custom key binding for invoking the command palette in the command { "command": "commandPalette", "launchMode": "commandLine", "keys": "" } ``` -> [!IMPORTANT] -> The `"launchMode"` setting is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). - ## Adding an icon to a command You can optionally add an icon to a command defined in your settings.json that appears in the command palette. This can be done by adding the `icon` property to the action. Icons can be a path to an image, a symbol from [Segoe MDL2 Assets](https://docs.microsoft.com/windows/uwp/design/style/segoe-ui-symbol-font), or any character, including emojis. diff --git a/TerminalDocs/custom-terminal-gallery/custom-schemes.md b/TerminalDocs/custom-terminal-gallery/custom-schemes.md index 81d403f5..4f4a70d3 100644 --- a/TerminalDocs/custom-terminal-gallery/custom-schemes.md +++ b/TerminalDocs/custom-terminal-gallery/custom-schemes.md @@ -1,5 +1,5 @@ --- -title: Custom Color Schemes guide +title: Windows terminal Custom Color Schemes guide description: Some sample configurations for Windows Terminal. author: cinnamon-msft ms.author: cinnamon diff --git a/TerminalDocs/custom-terminal-gallery/frosted-glass-theme.md b/TerminalDocs/custom-terminal-gallery/frosted-glass-theme.md index 4bcb3118..0f8ef9fa 100644 --- a/TerminalDocs/custom-terminal-gallery/frosted-glass-theme.md +++ b/TerminalDocs/custom-terminal-gallery/frosted-glass-theme.md @@ -1,5 +1,5 @@ --- -title: Windows Terminal Frosted Glass Theme Configuration +title: Windows Terminal Frosted Glass Theme description: This is a sample configuration for a frosted glass theme. author: cinnamon-msft ms.author: cinnamon diff --git a/TerminalDocs/custom-terminal-gallery/powerline-in-powershell.md b/TerminalDocs/custom-terminal-gallery/powerline-in-powershell.md index a3731c95..58eabf0f 100644 --- a/TerminalDocs/custom-terminal-gallery/powerline-in-powershell.md +++ b/TerminalDocs/custom-terminal-gallery/powerline-in-powershell.md @@ -1,5 +1,5 @@ --- -title: Windows Terminal Powerline in PowerShell Configuration +title: Windows Terminal Powerline in PowerShell description: This is the configuration and theme for Powerline in PowerShell. author: cinnamon-msft ms.author: cinnamon diff --git a/TerminalDocs/custom-terminal-gallery/raspberry-ubuntu.md b/TerminalDocs/custom-terminal-gallery/raspberry-ubuntu.md index c9ba4580..60d027bd 100644 --- a/TerminalDocs/custom-terminal-gallery/raspberry-ubuntu.md +++ b/TerminalDocs/custom-terminal-gallery/raspberry-ubuntu.md @@ -1,5 +1,5 @@ --- -title: Windows Terminal Raspberry Ubuntu Configuration +title: Windows Terminal Raspberry Ubuntu description: This is the theme for Raspberry Ubuntu. author: cinnamon-msft ms.author: cinnamon diff --git a/TerminalDocs/custom-terminal-gallery/retro-command-prompt.md b/TerminalDocs/custom-terminal-gallery/retro-command-prompt.md index 8d247545..38a40c20 100644 --- a/TerminalDocs/custom-terminal-gallery/retro-command-prompt.md +++ b/TerminalDocs/custom-terminal-gallery/retro-command-prompt.md @@ -1,5 +1,5 @@ --- -title: Windows Terminal Retro Command Prompt Configuration +title: Windows Terminal Retro Command Prompt description: This is the configuration for a retro command prompt in Windows Terminal. author: cinnamon-msft ms.author: cinnamon diff --git a/TerminalDocs/customize-settings/actions.md b/TerminalDocs/customize-settings/actions.md index 7aab3984..50e181a9 100644 --- a/TerminalDocs/customize-settings/actions.md +++ b/TerminalDocs/customize-settings/actions.md @@ -3,7 +3,7 @@ title: Windows Terminal Actions description: Learn how to create custom actions for Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 1/28/2021 +ms.date: 02/25/2021 ms.topic: how-to ms.localizationpriority: high --- @@ -165,6 +165,28 @@ This opens the search dialog box. More information on search can be found on the { "command": "find", "keys": "ctrl+shift+f" } ``` +### Find next/previous search match ([Preview](https://aka.ms/terminal-preview)) + +This lets you navigate through your search matches. + +**Command name:** `findMatch` + +**Default bindings:** + +```json +{ "command": { "action": "findMatch", "direction": "next" } }, +{ "command": { "action": "findMatch", "direction": "prev" } } +``` + +#### Actions + +| Name | Necessity | Accepts | Description | +| ---- | --------- | ------- | ----------- | +| `direction` | Required | `"next"`, `"prev"` | The direction to navigate through search results. | + +> [!IMPORTANT] +> The `"settingsUI"` value for `target` is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). + ### Open the dropdown This opens the dropdown menu. @@ -183,7 +205,7 @@ This opens either the default or custom settings files. Without the `target` fie **Command name:** `openSettings` -**Default binding:** +**Default bindings:** ```json { "command": "openSettings", "keys": "ctrl+," }, @@ -218,7 +240,7 @@ This allows you to enter "focus mode", which hides the tabs and title bar. **Command name:** `toggleFocusMode` -**Default bindings:** +**Default binding:** ```json { "command": "toggleFocusMode" } @@ -230,7 +252,7 @@ This allows you toggle the "always on top" state of the window. When in "always **Command name:** `toggleAlwaysOnTop` -**Default bindings:** +**Default binding:** ```json { "command": "toggleAlwaysOnTop" } @@ -246,7 +268,7 @@ For instance `"\u001b[A"` will behave as if the up arrow button had been pressed **Command name:** `sendInput` -**Default bindings:** +**Default binding:** _This command is not currently bound in the default settings_. @@ -456,10 +478,8 @@ This command changes the tab title into a text field that lets you edit the titl **Default binding:** -_This command is not currently bound in the default settings_. - ```json -{ "command": "openTabRenamer", "keys": "ctrl+alt+a" } +{ "command": "openTabRenamer" } ``` ### Change tab color @@ -498,7 +518,7 @@ This command can be used to open the color picker for the active tab. The color { "command": "openTabColorPicker" } ``` -### Move tab ([Preview](https://aka.ms/terminal-preview)) +### Move tab This command moves the tab "backward" and "forward", which is equivalent to "left" and "right" in left-to-right UI. @@ -506,14 +526,12 @@ This command moves the tab "backward" and "forward", which is equivalent to "lef **Default binding:** -_This command is not currently bound in the default settings_. - ```json // Move tab backward (left in LTR) -{ "command": { "action": "moveTab", "direction": "backward" }, "keys": "" } +{ "command": { "action": "moveTab", "direction": "backward" } } // Move tab forward (right in LTR) -{ "command": { "action": "moveTab", "direction": "forward" }, "keys": "" } +{ "command": { "action": "moveTab", "direction": "forward" } } ``` #### Actions @@ -522,11 +540,38 @@ _This command is not currently bound in the default settings_. | ---- | --------- | ------- | ----------- | | `direction` | Required | `"backward"`, `"forward"` | Direction in which the tab will move. | +
+ +___ + +## Window management commands + +### New window + +This creates a new window. Without any arguments, this will open the default profile in a new window (regardless of the setting of `windowingBehavior`). If an action is not specified, the default profile's equivalent setting will be used. + +**Command name:** `newWindow` + +**Default bindings:** + +```json +{ "command": "newWindow", "keys": "ctrl+shift+n" }, +``` + +#### Actions + +| Name | Necessity | Accepts | Description | +| ---- | --------- | ------- | ----------- | +| `commandline` | Optional | Executable file name as a string | Executable run within the tab. | +| `startingDirectory` | Optional | Folder location as a string | Directory in which the window will open. | +| `tabTitle` | Optional | String | Title of the window tab. | +| `index` | Optional | Integer | Profile that will open based on its position in the dropdown (starting at 0). | +| `profile` | Optional | Profile's name or GUID as a string | Profile that will open based on its GUID or name. | + > [!IMPORTANT] -> This feature is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). +> This feature is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview), version 1.7+.
- ___ ## Pane management commands @@ -565,9 +610,6 @@ This changes focus to a different pane depending on the direction. Setting the ` | ---- | --------- | ------- | ----------- | | `direction` | Required | `"left"`, `"right"`, `"up"`, `"down"`, `"previous"` | Direction in which the focus will move. | -> [!IMPORTANT] -> The `"previous"` direction is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). - ### Zoom a pane :::row::: @@ -610,6 +652,21 @@ This changes the size of the active pane. | ---- | --------- | ------- | ----------- | | `direction` | Required | `"left"`, `"right"`, `"up"`, `"down"` | Direction in which the pane will be resized. | +### Mark a pane as read-only ([Preview](https://aka.ms/terminal-preview)) + +You can mark a pane as read-only, which will prevent input from going into the text buffer. If you attempt to close or input text into a read-only pane, the terminal will display a popup warning instead. + +**Command name:** `toggleReadOnlyMode` + +**Default bindings:** + +```json +{ "command": "toggleReadOnlyMode" } +``` + +> [!IMPORTANT] +> This feature is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview/). + ### Split a pane This halves the size of the active pane and opens another. Without any arguments, this will open the default profile in the new pane. If an action is not specified, the default profile's equivalent setting will be used. @@ -640,9 +697,6 @@ This halves the size of the active pane and opens another. Without any arguments | `splitMode` | Optional | `"duplicate"` | Controls how the pane splits. Only accepts `"duplicate"`, which will duplicate the focused pane's profile into a new pane. | | `size` | Optional | Float | Specify how large the new pane should be, as a fraction of the current pane's size. `1.0` would be "all of the current pane", and `0.0` is "None of the parent". Defaults to `0.5`. | -> [!IMPORTANT] -> The `size` parameter is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). -
___ @@ -768,9 +822,6 @@ This scrolls the screen up to the top of the input buffer. { "command": "scrollToTop", "keys": "ctrl+shift+home" } ``` -> [!IMPORTANT] -> This feature is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). - ### Scroll to the latest history This scrolls the screen down to the bottom of the input buffer. @@ -783,9 +834,6 @@ This scrolls the screen down to the bottom of the input buffer. { "command": "scrollToBottom", "keys": "ctrl+shift+end" } ``` -> [!IMPORTANT] -> This feature is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). -
___ diff --git a/TerminalDocs/customize-settings/appearance.md b/TerminalDocs/customize-settings/appearance.md index 5647e1c8..88c08bbf 100644 --- a/TerminalDocs/customize-settings/appearance.md +++ b/TerminalDocs/customize-settings/appearance.md @@ -3,7 +3,7 @@ title: Windows Terminal Appearance Settings description: Learn how to customize appearance settings within Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 01/28/2021 +ms.date: 02/25/2021 ms.topic: how-to ms.localizationpriority: high --- @@ -13,7 +13,7 @@ ms.localizationpriority: high The properties listed below affect the entire terminal window, regardless of the profile settings. These should be placed at the root of your settings.json file. > [!IMPORTANT] -> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). Detailed instructions on how to enable the settings UI can be found on the [Troubleshooting page](./../troubleshooting.md#open-the-settings-ui). +> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). ## Theme diff --git a/TerminalDocs/customize-settings/color-schemes.md b/TerminalDocs/customize-settings/color-schemes.md index 9aee3aec..4d5e7a5b 100644 --- a/TerminalDocs/customize-settings/color-schemes.md +++ b/TerminalDocs/customize-settings/color-schemes.md @@ -3,7 +3,7 @@ title: Windows Terminal Color Schemes description: Learn how to create color schemes for Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 01/28/2021 +ms.date: 02/25/2021 ms.topic: how-to ms.localizationpriority: high --- @@ -13,7 +13,7 @@ ms.localizationpriority: high Windows Terminal lets you define your own color schemes, either by using the built-in preset schemes, or by creating your own scheme from scratch. To change schemes, you'll need to edit the settings.json file in an editor such as [Visual Studio Code](https://code.visualstudio.com/). > [!IMPORTANT] -> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). Detailed instructions on how to enable the settings UI can be found on the [Troubleshooting page](./../troubleshooting.md#open-the-settings-ui). +> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). ## Switching to a different color scheme diff --git a/TerminalDocs/customize-settings/interaction.md b/TerminalDocs/customize-settings/interaction.md index 4b442c26..b806cc91 100644 --- a/TerminalDocs/customize-settings/interaction.md +++ b/TerminalDocs/customize-settings/interaction.md @@ -3,7 +3,7 @@ title: Windows Terminal Interaction Settings description: Learn how to customize interaction settings within Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 01/28/2021 +ms.date: 02/25/2021 ms.topic: how-to ms.localizationpriority: high --- @@ -13,7 +13,7 @@ ms.localizationpriority: high The properties listed below affect the entire terminal window, regardless of the profile settings. These should be placed at the root of your settings.json file. > [!IMPORTANT] -> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). Detailed instructions on how to enable the settings UI can be found on the [Troubleshooting page](./../troubleshooting.md#open-the-settings-ui). +> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). ## Automatically copy selection to clipboard @@ -140,6 +140,25 @@ The tab switcher will open on the initial press of the actions for `nextTab` and ___ +## Automatically focus pane on mouse hover ([Preview](https://aka.ms/terminal-preview)) + +When this is set to `true`, the terminal will move focus to the pane on mouse hover. When it's set to `false`, a click will be required to focus the pane using the mouse. + +**Property name:** `focusFollowMouse` + +**Necessity:** Optional + +**Accepts:** `true`, `false` + +**Default value:** `false` + +> [!IMPORTANT] +> This feature is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). + +
+ +___ + ## Paste warnings ### Warn when the text to paste is very large diff --git a/TerminalDocs/customize-settings/profile-advanced.md b/TerminalDocs/customize-settings/profile-advanced.md index 0d74522f..17439593 100644 --- a/TerminalDocs/customize-settings/profile-advanced.md +++ b/TerminalDocs/customize-settings/profile-advanced.md @@ -3,7 +3,7 @@ title: Windows Terminal Advanced Profile Settings description: Learn how to customize the advanced profile settings within Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 01/28/2021 +ms.date: 02/25/2021 ms.topic: how-to ms.localizationpriority: high --- @@ -24,7 +24,7 @@ The settings listed below are specific to each unique profile. If you'd like a s ``` > [!IMPORTANT] -> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). Detailed instructions on how to enable the settings UI can be found on the [Troubleshooting page](./../troubleshooting.md#open-the-settings-ui). +> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). ## Suppress title changes @@ -134,9 +134,6 @@ Controls what happens when the application emits a BEL character. When set to `" **Default value:** `"audible"` -> [!IMPORTANT] -> The `"all"` and `"visual"` bell notification styles are only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). -
___ diff --git a/TerminalDocs/customize-settings/profile-appearance.md b/TerminalDocs/customize-settings/profile-appearance.md index 0479a575..6fe96c29 100644 --- a/TerminalDocs/customize-settings/profile-appearance.md +++ b/TerminalDocs/customize-settings/profile-appearance.md @@ -3,7 +3,7 @@ title: Windows Terminal Appearance Profile Settings description: Learn how to customize the appearance profile settings within Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 01/28/2021 +ms.date: 02/25/2021 ms.topic: how-to ms.localizationpriority: high --- @@ -24,7 +24,7 @@ The settings listed below are specific to each unique profile. If you'd like a s ``` > [!IMPORTANT] -> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). Detailed instructions on how to enable the settings UI can be found on the [Troubleshooting page](./../troubleshooting.md#open-the-settings-ui). +> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). ## Text @@ -118,9 +118,6 @@ This sets the cursor shape for the profile. The possible cursors are as follows: **Default value:** `"bar"` -> [!IMPORTANT] -> The `"doubleUnderscore"` cursor shape is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). - ### Cursor height This sets the percentage height of the cursor starting from the bottom. This will only work when `cursorShape` is set to `"vintage"`. @@ -353,7 +350,7 @@ This sets the cursor color of the profile. This will override the `cursorColor` ___ -## Pixel shader effects ([Preview](https://aka.ms/terminal-preview)) +## Pixel shader effects This setting allows a user to specify the path to a custom pixel shader to use with the terminal content. This is an experimental feature and its continued existence is not guaranteed. For more details on authoring custom pixel shaders for the terminal, see [this documentation](https://github.com/microsoft/terminal/blob/main/samples/PixelShaders/README.md). @@ -364,6 +361,3 @@ If set, this will override the `experimental.retroTerminalEffect` setting. **Necessity:** Optional **Accepts:** A path to an `.hlsl` shader file, as a string - -> [!IMPORTANT] -> This feature is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview/). diff --git a/TerminalDocs/customize-settings/profile-general.md b/TerminalDocs/customize-settings/profile-general.md index 88463a55..3287656e 100644 --- a/TerminalDocs/customize-settings/profile-general.md +++ b/TerminalDocs/customize-settings/profile-general.md @@ -3,7 +3,7 @@ title: Windows Terminal General Profile Settings description: Learn how to customize the general profile settings within Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 01/28/2021 +ms.date: 02/25/2021 ms.topic: how-to ms.localizationpriority: high --- @@ -24,7 +24,7 @@ The settings listed below are specific to each unique profile. If you'd like a s ``` > [!IMPORTANT] -> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). Detailed instructions on how to enable the settings UI can be found on the [Troubleshooting page](./../troubleshooting.md#open-the-settings-ui). +> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). ## Name @@ -93,7 +93,7 @@ This sets the icon that displays within the tab, dropdown menu, jumplist, and ta **Accepts:** File location as a string, or an emoji -**Example:** Placing the icon image `ubuntu.ico` in the folder located at `%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\RoamingState`, you can display the icon by adding this line to the profile in your settings.json: `"icon": "ms-appdata:///roaming/ubuntu.ico"`. +**Example:** By placing the icon image `ubuntu.ico` in the folder located at `%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\RoamingState`, you can display the icon by adding this line to the profile in your settings.json: `"icon": "ms-appdata:///roaming/ubuntu.ico"`.
___ diff --git a/TerminalDocs/customize-settings/rendering.md b/TerminalDocs/customize-settings/rendering.md index f02fcc20..fa31b614 100644 --- a/TerminalDocs/customize-settings/rendering.md +++ b/TerminalDocs/customize-settings/rendering.md @@ -3,7 +3,7 @@ title: Windows Terminal Rendering Settings description: Learn how to customize rendering settings within Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 01/28/2021 +ms.date: 02/25/2021 ms.topic: how-to ms.localizationpriority: high --- @@ -15,7 +15,7 @@ The properties listed below affect the entire terminal window, regardless of the If you are thinking about changing the rendering settings, additional information is provided on the [Troubleshooting page](./../troubleshooting.md#the-text-is-blurry) to help guide you. > [!IMPORTANT] -> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). Detailed instructions on how to enable the settings UI can be found on the [Troubleshooting page](./../troubleshooting.md#open-the-settings-ui). +> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). ## Redraw entire screen when display updates diff --git a/TerminalDocs/customize-settings/startup.md b/TerminalDocs/customize-settings/startup.md index 5c6764d5..b06c2af6 100644 --- a/TerminalDocs/customize-settings/startup.md +++ b/TerminalDocs/customize-settings/startup.md @@ -3,7 +3,7 @@ title: Windows Terminal Startup Settings description: Learn how to customize startup settings within Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 01/28/2021 +ms.date: 02/25/2021 ms.topic: how-to ms.localizationpriority: high --- @@ -13,7 +13,7 @@ ms.localizationpriority: high The properties listed below affect the entire terminal window, regardless of the profile settings. These should be placed at the root of your settings.json file. > [!IMPORTANT] -> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). Detailed instructions on how to enable the settings UI can be found on the [Troubleshooting page](./../troubleshooting.md#open-the-settings-ui). +> The settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). ## Default profile @@ -65,6 +65,29 @@ This defines whether the terminal will launch as maximized, full screen, or in a ___ +## New instance behavior ([Preview](https://aka.ms/terminal-preview)) + +This setting controls how new terminal instances attach to existing windows. This property is only used if the `--window,-w window` [command line argument](./../command-line-arguments.md) is not provided. This setting accepts the following possible values: + +* `useNew`: Create a new window, always. This is how the terminal always behaved prior to version 1.7. +* `useExisting`: Create new tabs in the most recently used window on this desktop. If there's not an existing window on this virtual desktop, then create a new terminal window. +* `useAnyExisting`: Create new tabs in the most recently used window, regardless of which virtual desktop the window is on. + +**Property name:** `windowingBehavior` + +**Necessity:** Optional + +**Accepts:** `"useNew"`, `"useExisting"`, `"useAnyExisting"` + +**Default value:** `"useNew"` + +> [!IMPORTANT] +> This setting is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). + +
+ +___ + ## Launch size ### Columns on first launch @@ -111,6 +134,34 @@ This sets the pixel position of the top left corner of the window upon first loa ___ +## Center on launch ([Preview](https://aka.ms/terminal-preview)) + +When set to `true`, the terminal window will auto-center itself on the display it opens on. The terminal will use the `"initialPosition"` to determine which display to open on. + +This interacts with the other launch settings in the following ways: + +* `"initialPos": x,y`, `"centerOnLaunch": true`, `"launchMode": "default"`: center on the monitor that `x,y` is on. +* `"initialPos": x,y`, `"centerOnLaunch": true`, `"launchMode": "maximized"`: maximized on the monitor that `x,y` is on (`centerOnLaunch` adds nothing). +* `"initialPos": `, `"centerOnLaunch": true`, `"launchMode": "default"`: center on the default monitor. +* `"initialPos": `, `"centerOnLaunch": true`, `"launchMode": "focus"`: center and enter focus mode on the default monitor. +* `"initialPos": `, `"centerOnLaunch": true`, `"launchMode": "maximized"`: maximized on the default monitor (`centerOnLaunch` adds nothing). + +**Property name:** `centerOnLaunch` + +**Necessity:** Optional + +**Accepts:** `true`, `false` + +**Default value:** `false` + + +> [!IMPORTANT] +> This feature is only available in [Windows Terminal Preview](https://aka.ms/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](./../dynamic-profiles.md). @@ -127,7 +178,7 @@ This sets which dynamic profile generators are disabled, preventing them from ad ___ -## Startup actions ([Preview](https://aka.ms/terminal-preview)) +## Startup actions This sets the list of actions to execute on startup, allowing the terminal to launch with a custom set of tabs and panes by default. These actions will be applied only if no command line arguments were supplied. The list of actions is represented by a string with the same format as commands in the command line arguments. For more information about the commands format, visit the [Command line arguments page](./../command-line-arguments.md). @@ -138,6 +189,3 @@ This sets the list of actions to execute on startup, allowing the terminal to la **Accepts:** String representing a list of commands to run **Default value:** `""` - -> [!IMPORTANT] -> This feature is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). diff --git a/TerminalDocs/index.md b/TerminalDocs/index.md index 21036615..28673743 100644 --- a/TerminalDocs/index.md +++ b/TerminalDocs/index.md @@ -1,5 +1,5 @@ --- -title: Windows Terminal overview +title: An overview on Windows Terminal description: Learn about Windows Terminal and how it can improve your command line workflow. author: cinnamon-msft ms.author: cinnamon diff --git a/TerminalDocs/json-fragment-extensions.md b/TerminalDocs/json-fragment-extensions.md new file mode 100644 index 00000000..7b26e1e2 --- /dev/null +++ b/TerminalDocs/json-fragment-extensions.md @@ -0,0 +1,138 @@ +--- +title: Windows Terminal JSON Fragment Extensions +description: Learn how to use JSON fragment extensions in Windows Terminal. +author: cinnamon-msft +ms.author: cinnamon +ms.date: 02/25/2021 +ms.topic: how-to +--- + +# JSON fragment extensions in Windows Terminal + +> [!IMPORTANT] +> JSON fragment extension support is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). + +JSON fragment extensions are snippets of JSON that application developers can write to add new profiles to users' settings, or even modify certain existing profiles. They can also be used to add new color schemes to users' settings. + +## Structure of the JSON files + +The JSON file should be split up into 2 lists, one for profiles and one for schemes. Here is an example of a json file that adds a new profile, modifies an existing profile, and creates a new color scheme: + +```JSON +{ + "profiles": [ + { + // update the profile with the GUID below + "updates": "{2c4de342-38b7-51cf-b940-23e9ae97f518}", + "fontSize": 16, + "fontWeight": "thin" + }, + { + // create a new profile + "name": "Cool Profile", + "commandline": "powershell.exe", + "antialiasingMode": "aliased", + "fontWeight": "bold", + "colorScheme": "Postmodern Tango Light" + } + ], + "schemes": [ + { + // create a new color scheme + "name": "Postmodern Tango Light", + + "black": "#0C0C0C", + "red": "#C50F1F", + "green": "#13A10E", + "yellow": "#C19C00", + "blue": "#0037DA", + "purple": "#881798", + "cyan": "#3A96DD", + "white": "#CCCCCC", + "brightBlack": "#767676", + "brightRed": "#E74856", + "brightGreen": "#16C60C", + "brightYellow": "#F9F1A5", + "brightBlue": "#3B78FF", + "brightPurple": "#B4009E", + "brightCyan": "#61D6D6", + "brightWhite": "#F2F2F2" + } + ] +} +``` + +The first item in the `"profiles"` list updates an existing profile, identifying the profile it wishes to update via the GUID provided to the `"updates"` field (details on how to obtain the GUID are in the next section). The second item in that list creates a new profile called "Cool Profile". + +In the `"schemes"` list, a new color scheme called "Postmodern Tango Light" is defined, and can be subsequently referenced by the user in their settings file or in this JSON file itself (notice that "Cool Profile" uses this newly defined color scheme). + +Of course, if the developer only wishes to add/modify profiles without adding color schemes (and vice-versa), only the relevant list needs to be present and the other list can be omitted. + +## How to determine the GUID of an existing profile + +The only profiles that can be modified through fragments are the default profiles, Command Prompt and PowerShell, as well as [dynamic profiles](./dynamic-profiles.md). To determine the GUID of the profile to be updated, use a Version 5 UUID generator with the following namespace GUID and name: + +- The namespace GUID: `{2BDE4A90-D05F-401C-9492-E40884EAD1D8}` +- The name of the profile to be updated + +As a sanity check, a profile called 'Ubuntu' will get the generated GUID: `{2C4DE342-38B7-51CF-B940-2309A097F518}` + +## Minimum requirements for settings added with fragments + +There are some minimal restrictions on what can be added to user settings using JSON fragments: + +- For new profiles added via fragments, the new profile must, at a minimum, define a name for itself. +- For new color schemes added via fragments, the new color scheme must define a name for itself, as well as define every color in the color table (i.e. the colors "black" through "brightYellow" in the example image above). + +## Where to place the JSON fragment files + +The location to place the JSON fragment files varies depending on the installation method of the application that wishes to place them. + +### Microsoft Store applications + +For applications installed through the Microsoft Store (or similar), the application must declare itself to be an app extension. More details on app extensions can be found in the [Microsoft Docs](https://docs.microsoft.com/windows/uwp/launch-resume/how-to-create-an-extension) and the necessary section is replicated here. The appxmanifest file of the package must include: + +```xml + + ... + + + ... + + ... + + + + + + + + ... + +``` + +Key things to note: + +- The `"Name"` field must be `com.microsoft.windows.terminal.settings` for Windows Terminal to be able to detect the extension. +- The `"Id"` field can be filled out as the developer wishes. +- The `"PublicFolder"` field should have the name of the folder, relative to the package root, where the JSON files are stored (this folder is typically called "Public" but can be named something else if the developer wishes). +- Inside the public folder, a subdirectory called "Fragments" should be created, and the JSON files should be stored in that subdirectory. + +### Applications installed from the web + +For applications installed from the web, there are 2 cases. + +The first is that the installation is for all the users on the system. In this case, the JSON files should be added to the folder: + +`C:\ProgramData\Microsoft\Windows Terminal\Fragments\{app-name}` + +In the second case, the installation is only for the current user. In this case, the JSON files should be added to the folder: + +`C:\Users\\AppData\Local\Microsoft\Windows Terminal\Fragments\{app-name}` + +Note that both the `ProgramData` and `LocalAppData` folders are known folders that the installer should be able to access. If in either case, if the `Windows Terminal\Fragments` directory does not exist, the installer should create it. diff --git a/TerminalDocs/new-terminal-arguments.md b/TerminalDocs/new-terminal-arguments.md index c3c002f3..62635209 100644 --- a/TerminalDocs/new-terminal-arguments.md +++ b/TerminalDocs/new-terminal-arguments.md @@ -1,6 +1,6 @@ --- -title: New Terminal Arguments in the Windows Terminal -description: New Terminal arguments in the Windows Terminal. +title: New Terminal Arguments in Windows Terminal +description: New Terminal arguments in Windows Terminal. author: cinnamon-msft ms.author: cinnamon ms.date: 08/26/2020 diff --git a/TerminalDocs/panes.md b/TerminalDocs/panes.md index 2d7af769..ae2e8d11 100644 --- a/TerminalDocs/panes.md +++ b/TerminalDocs/panes.md @@ -1,9 +1,9 @@ --- title: Windows Terminal Panes -description: Learn how to split panes in the Windows Terminal. +description: Learn how to split panes in Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 09/22/2020 +ms.date: 02/25/2021 ms.topic: how-to --- @@ -92,4 +92,29 @@ This can be done by adding the `splitMode` property with `duplicate` as the valu { "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" } ``` +### Zooming a pane + +You can zoom the focused pane to fill the entire contents of the window. + +![Windows Terminal toggle pane zoom](./../images/toggle-pane-zoom.gif) + +This can be done by using the `togglePaneZoom` command. + +```json +{ "command": "togglePaneZoom" } +``` + +### Marking a pane as read-only ([Preview](https://aka.ms/terminal-preview)) + +You can mark a pane as read-only, which will prevent input from going into the text buffer. If you attempt to close or input text into a read-only pane, the terminal will display a popup warning instead. + +You can toggle read-only mode on a pane with the `toggleReadOnlyMode` command. + +``` +{ "command": "toggleReadOnlyMode" }, +``` + +> [!IMPORTANT] +> This feature is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview/). + [!INCLUDE [new-terminal-arguments](./new-terminal-arguments.md)] diff --git a/TerminalDocs/search.md b/TerminalDocs/search.md index 7377b9c6..07fecd26 100644 --- a/TerminalDocs/search.md +++ b/TerminalDocs/search.md @@ -1,6 +1,6 @@ --- title: Windows Terminal Search -description: Learn how to search in the Windows Terminal. +description: Learn how to search in Windows Terminal. author: cinnamon-msft ms.author: cinnamon ms.date: 09/22/2020 diff --git a/TerminalDocs/troubleshooting.md b/TerminalDocs/troubleshooting.md index 57afe484..551740c8 100644 --- a/TerminalDocs/troubleshooting.md +++ b/TerminalDocs/troubleshooting.md @@ -1,9 +1,9 @@ --- title: Windows Terminal Troubleshooting -description: Learn fixes to common obstacles in the Windows Terminal. +description: Learn fixes to common obstacles in Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 1/28/2021 +ms.date: 02/25/2021 ms.topic: overview ms.localizationpriority: high --- @@ -12,14 +12,6 @@ ms.localizationpriority: high This guide addresses some of the common errors and obstacles you may encounter when using Windows Terminal. -## Open the settings UI - -At the moment, the settings UI is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview). In order to open the settings UI, you will have to add the `"openSettings"` action to your `"actions"` array in order to open it with the command palette or keyboard. - -``` -{ "command": { "action": "openSettings", "target": "settingsUI" }, "keys": "ctrl+shift+," }, -``` - ## Set your WSL distribution to start in the home `~` directory when launched By default, the `startingDirectory` of a profile is `%USERPROFILE%` (`C:\Users\`). This is a Windows path. For WSL, however, you may want to use the WSL home path instead. `startingDirectory` only accepts a Windows-style path, so setting it to start within a WSL distribution requires a prefix. diff --git a/TerminalDocs/tutorials/powerline-setup.md b/TerminalDocs/tutorials/powerline-setup.md index 57f41e23..f469a2c0 100644 --- a/TerminalDocs/tutorials/powerline-setup.md +++ b/TerminalDocs/tutorials/powerline-setup.md @@ -1,9 +1,9 @@ --- title: Windows Terminal Powerline Setup -description: In this tutorial, you learn how to set up Powerline in the Windows Terminal. +description: In this tutorial, you learn how to set up Powerline in Windows Terminal. author: cinnamon-msft ms.author: cinnamon -ms.date: 1/28/2021 +ms.date: 02/25/2021 ms.topic: tutorial #Customer intent: As a developer or IT admin, I want to set up Powerline in my Windows Terminal so that I can have a customized command line experience. --- @@ -65,10 +65,14 @@ In your PowerShell profile, add the following to the end of the file: ```powershell Import-Module posh-git Import-Module oh-my-posh -Set-Theme Paradox +Set-PoshPrompt -Theme paradox ``` -Now, each new instance starts by importing Posh-Git and Oh-My-Posh, then setting the Paradox theme from Oh-My-Posh. Oh-My-Posh comes with several [built-in themes](https://github.com/JanDeDobbeleer/oh-my-posh#themes). +Now, each new instance starts by importing Posh-Git and Oh-My-Posh, then setting the Paradox theme from Oh-My-Posh. Oh-My-Posh comes with several [built-in themes](https://ohmyposh.dev/docs/themes). If you decide to use Cascadia Code PL as a font, oh-my-posh themes that contain `minimal` +function without the need for additional icons. You can also [create a custom theme](https://ohmyposh.dev/docs/installation#change-the-theme) to match the font of your choice. + +> [!IMPORTANT] +> Script execution policy must be set to either **RemoteSigned** or **Unrestricted** in order for the profile script to run. Run this command to see your current execution policy `Get-ExecutionPolicy`. [Learn more about Execution Policies](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies) ### Set Cascadia Code PL as your font @@ -88,6 +92,7 @@ Your Windows PowerShell profile settings.json file should now look like this: "hidden": false }, ``` + > [!TIP] > If you also use the integrated terminal in Visual Studio Code, you should add `"terminal.integrated.fontFamily": "Cascadia Code PL"` to your Visual Studio Code settings to make sure Powerline works there as well. @@ -95,11 +100,25 @@ Your Windows PowerShell profile settings.json file should now look like this: ### WSL Ubuntu prerequisites -Ubuntu has several Powerline options to install from. This tutorial will be using Go and Powerline-Go: +Ubuntu has several Powerline options to install from. This tutorial will be using oh-my-posh for Linux: + +First, install oh-my-posh: + +```bash +wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh +chmod +x /usr/local/bin/oh-my-posh +``` + +The second step is optonal. Oh-my-posh can use the same theme config regardless of the shell or evironment, so if you're already using +it on Windows Powershell for example, you can reuse that theme configuration rather than download the themes. +If you plan to use it within Ubuntu WSL only, fetch the [themes](https://ohmyposh.dev/docs/themes) so you can get started right away: ```bash -sudo apt install golang-go -go get -u github.com/justjanne/powerline-go +mkdir ~/.poshthemes +wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip +unzip ~/.poshthemes/themes.zip -d ~/.poshthemes +chmod u+rw ~/.poshthemes/*.json +rm ~/.poshthemes/themes.zip ``` > [!TIP] @@ -111,20 +130,13 @@ go get -u github.com/justjanne/powerline-go ### Customize your Ubuntu prompt -Open your `~/.bashrc` file with `nano ~/.bashrc` or the text editor of your choice. This is a bash script that runs every time bash starts. Add the following, though beware that GOPATH may already exist: +Open your `~/.bashrc` file with `nano ~/.bashrc` or the text editor of your choice. This is a bash script that runs every time bash starts. Add the following (change the theme to the one you like): ```bash -GOPATH=$HOME/go -function _update_ps1() { - PS1="$($GOPATH/bin/powerline-go -error $?)" -} -if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then - PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" -fi +eval "$(oh-my-posh --init --shell bash --config ~/.poshthemes/jandedobbeleer.omp.json)" ``` ## Additional resources * [Scott Hanselman's "How to make a pretty prompt in Windows Terminal"](https://www.hanselman.com/blog/HowToMakeAPrettyPromptInWindowsTerminalWithPowerlineNerdFontsCascadiaCodeWSLAndOhmyposh.aspx) - -* [How to change/set up bash custom prompt (PS1) in Linux](https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html) +* [Oh my Posh documentation](https://ohmyposh.dev) diff --git a/TerminalDocs/tutorials/ssh.md b/TerminalDocs/tutorials/ssh.md index 3afc024b..5b5c4adf 100644 --- a/TerminalDocs/tutorials/ssh.md +++ b/TerminalDocs/tutorials/ssh.md @@ -1,6 +1,6 @@ --- title: Windows Terminal SSH -description: In this tutorial, learn how to set up an SSH connection in the Windows Terminal. +description: In this tutorial, learn how to set up an SSH connection in Windows Terminal. author: cinnamon-msft ms.author: cinnamon ms.date: 05/19/2020 diff --git a/TerminalDocs/tutorials/tab-title.md b/TerminalDocs/tutorials/tab-title.md index be2629dc..96f51195 100644 --- a/TerminalDocs/tutorials/tab-title.md +++ b/TerminalDocs/tutorials/tab-title.md @@ -1,6 +1,6 @@ --- title: Windows Terminal Tab Title Setup -description: In this tutorial, you learn how to set the tab title in the Windows Terminal. +description: In this tutorial, you learn how to set the tab title in Windows Terminal. author: cinnamon-msft ms.author: cinnamon ms.date: 05/19/2020 @@ -46,12 +46,26 @@ A shell has full control over its own title. However, each shell sets its title Note that some Linux distributions (e.g. Ubuntu) set their title automatically as you interact with the shell. If the above command doesn't work, run the following command: ```bash -PS1=$ -PROMPT_COMMAND= -echo -ne "\033]0;New Title\a" +export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +echo -ne '\033]0;New Title\a' ``` -This will change the title to 'New Title', and also set the prompt to '$'. +This will change the title to 'New Title'. + +For easier access add this to the end of your `~/.bashrc`: + +```bash +settitle () { + export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' + echo -ne '\033]0;'"$1"'\a' +} +``` + +After you reopen your shell, you now can change the shell's title at any time using the following command: + +```bash +settitle 'New Title' +``` ## Use the `suppressApplicationTitle` setting