Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release 1.7 into master #264

Merged
merged 13 commits into from
Feb 27, 2021
6 changes: 4 additions & 2 deletions TerminalDocs/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
72 changes: 58 additions & 14 deletions TerminalDocs/command-line-arguments.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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

Expand All @@ -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` `<window-id>` | Launches the terminal in a specific window. |

| Command | Parameters | Description |
| ------- | ---------- | ----------- |
Expand All @@ -44,16 +45,62 @@ 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`.

## Command line argument examples

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.

<!-- Start tab selectors. -->
#### [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.

---
<!-- End tab selectors. -->

### 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:
Expand Down Expand Up @@ -82,7 +129,7 @@ Execution aliases do not work in WSL distributions. If you want to use wt.exe fr
---
<!-- End tab selectors. -->

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

Expand Down Expand Up @@ -260,7 +307,7 @@ Execution aliases do not work in WSL distributions. If you want to use wt.exe fr
---
<!-- End tab selectors. -->

### 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:

Expand Down Expand Up @@ -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:
Expand Down
7 changes: 2 additions & 5 deletions TerminalDocs/command-palette.md
Original file line number Diff line number Diff line change
@@ -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
---
Expand Down Expand Up @@ -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.
Expand Down
74 changes: 46 additions & 28 deletions TerminalDocs/customize-settings/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down Expand Up @@ -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.
Expand All @@ -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+," },
Expand Down Expand Up @@ -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" }
Expand All @@ -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" }
Expand All @@ -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_.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -498,22 +518,20 @@ 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.

**Command name:** `moveTab`

**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
Expand All @@ -522,9 +540,6 @@ _This command is not currently bound in the default settings_.
| ---- | --------- | ------- | ----------- |
| `direction` | Required | `"backward"`, `"forward"` | Direction in which the tab will move. |

> [!IMPORTANT]
> This feature is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview).

<br />

___
Expand Down Expand Up @@ -565,9 +580,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:::
Expand Down Expand Up @@ -610,6 +622,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.
Expand Down Expand Up @@ -640,9 +667,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).

<br />

___
Expand Down Expand Up @@ -768,9 +792,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.
Expand All @@ -783,9 +804,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).

<br />

___
Expand Down
4 changes: 2 additions & 2 deletions TerminalDocs/customize-settings/appearance.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand All @@ -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

Expand Down
Loading