Skip to content

Commit

Permalink
document how to start windows terminal and have it execute a command (#…
Browse files Browse the repository at this point in the history
…298)

* document how to start windows terminal and have it execute a command #296

* Separated the argument examples 

and included explanations of what they accomplish

* fix typo

* remove version from url

Co-authored-by: Mark Iannucci <mark.iannucci@dhha.org>
Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com>
  • Loading branch information
3 people authored Apr 30, 2021
1 parent 0039bac commit a49a379
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions TerminalDocs/command-line-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ 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.

### Passing an argument to the default shell

To start an instance of Windows Terminal and have it execute a command, call `wt.exe` followed by your command.

Here's an example of calling Windows Terminal to pass a [ping](https://docs.microsoft.com/windows-server/administration/windows-commands/ping) command argument to echo an IP address:

```powershell
wt ping docs.microsoft.com
```

Here's an example of calling Windows Terminal to open a new tab with a PowerShell command line, confirming to call the [Start-Service](https://docs.microsoft.com/powershell/module/microsoft.powershell.management/start-service) command, and opening another new tab with Windows Command Prompt open to the `/k` directory:

```cmd
wt new-tab PowerShell -c Start-Service ; new-tab cmd /k dir
```

### Target a specific window

> [!IMPORTANT]
Expand Down

0 comments on commit a49a379

Please sign in to comment.