Skip to content

Commit

Permalink
Merge master into live (#268)
Browse files Browse the repository at this point in the history
* command-line-arguments.md: Tag the Command Prompt code blocks

For some reason they were tagged as bash, which broke highlighting in at least one of them.

* fixed typo (#220)

in line 98 it's `C:\\path\\to\\icon.png` while in line 115 it was `C:\\path\\to\\icon` so I've added the missing `.png`

* Add note about escaping characters with backslash (#230)

Originally filed by Andrewery https://github.com/MicrosoftDocs/terminal/pull/134/files

* Add icon example and folder location (#231)

From #135

* Add icon example and folder location

As originally submitted by @aloneguid in #135

* Remove code brackets for readability

* Add spacing

* Fix default value by escaping characters (#232)

Original submission: https://github.com/MicrosoftDocs/terminal/pull/134/files

* Add info about the command palette (#180)

* Add info about the command palette

1. Add info about the command palette.
2. Typo fixes (e.g. "quick-start guide" instead of "quickstart")
3. Style fix, e.g. we don't have a keyboard key whose full name is "alt+shift+plus".

* revert description

Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com>

* Add backslash escape note (#233)

...from PR #181

* Add a note about hiding dynamic profiles (#186)

* Add a note about hiding dynamic profiles

* Minor writing updates

Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com>

* Clarify adding profile in ssh tutorial. Fixes #183 (#193)

* Clarify adding profile in ssh tutorial. Fixes: #183

* Remove  from docs link

* Add guid command for powershell (#234)

migrated from PR https://github.com/MicrosoftDocs/terminal/pull/199/files

* Change "i.e." to "e.g." (#207)

This seems to be the intended meaning: There are Linux distributions that are not Ubuntu, but Ubuntu is an example of a Linux distribution for which the behavior is the given.

* Old Ubuntu: Use up-to-date version of golang (#216)

Currently, the install recommends using an out-of-date version of golang, which in turn causes issues while installing powerline-go.

* Add startingDirectory example (#237)

* Add startingDirectory example

* Format startingDirectory entry

* remove icon file type

Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com>

* Change icon description to example

* Change false to true

Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com>

* Remove unnecessary sentence

Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com>

* Typo fixes

Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com>

* link fix

Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com>

* Capitalization fixes

Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com>

* shortcut fixes

Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com>

* page_title_updates_terminal (#243)

* Add docs for `newWindow` action (#259)

* refactor(powerline): update for oh-my-posh V3 (#263)

* Improved title setting procedure on bash/Ubuntu so that it doesn't destroy `PS1` (#123)

Improved title setting procedure on bash/Ubuntu so that it doesn't destroy `PS1`

* Update powerline-setup.md (#240)

* Update powerline-setup.md

* Update powerline-setup.md

* Update powerline-setup.md

* fix typo

* Merge release 1.7 into master (#264)

Co-authored-by: Mike Griese <migrie@microsoft.com>
Co-authored-by: Don-Vito <khvitaly@gmail.com>

Co-authored-by: Samuel Bronson <naesten@gmail.com>
Co-authored-by: LSC <schad.lucas@gmail.com>
Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com>
Co-authored-by: skycommand <jadangerbrooks@hotmail.com>
Co-authored-by: Mike Griese <migrie@microsoft.com>
Co-authored-by: Cameron Durham <cdurham@usc.edu>
Co-authored-by: Søren Fuglede Jørgensen <github@fuglede.dk>
Co-authored-by: Janne Mareike Koschinski <janne@kuschku.de>
Co-authored-by: Meenal Patel <42360097+v-mepa@users.noreply.github.com>
Co-authored-by: Jan De Dobbeleer <2492783+JanDeDobbeleer@users.noreply.github.com>
Co-authored-by: Dakkaron <dak1st@gmx.at>
Co-authored-by: Ibrahim Rouis <73853380+rouisibra@users.noreply.github.com>
Co-authored-by: Don-Vito <khvitaly@gmail.com>
  • Loading branch information
14 people committed Feb 28, 2021
1 parent 85519c6 commit d846289
Show file tree
Hide file tree
Showing 26 changed files with 453 additions and 123 deletions.
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
2 changes: 1 addition & 1 deletion TerminalDocs/custom-terminal-gallery/custom-schemes.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion TerminalDocs/custom-terminal-gallery/raspberry-ubuntu.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit d846289

Please sign in to comment.