From 8cd171980e8cc4ecc9539f172a62e1cac95c53c5 Mon Sep 17 00:00:00 2001 From: Mark Iannucci Date: Tue, 23 Mar 2021 21:06:27 -0600 Subject: [PATCH 1/4] document how to start windows terminal and have it execute a command #296 --- TerminalDocs/command-line-arguments.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/TerminalDocs/command-line-arguments.md b/TerminalDocs/command-line-arguments.md index 1ca51beb..9275c26c 100644 --- a/TerminalDocs/command-line-arguments.md +++ b/TerminalDocs/command-line-arguments.md @@ -52,6 +52,15 @@ 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. + +```cmd +wt ping docs.microsoft.com +wt new-tab PowerShell -c Start-Service ; new-tab cmd /k dir +``` + ### Target a specific window > [!IMPORTANT] From 25a3fa5ab23b208bd01adb0b87b3cf4e6dba37c7 Mon Sep 17 00:00:00 2001 From: Matt Wojciakowski Date: Fri, 30 Apr 2021 12:18:05 -0700 Subject: [PATCH 2/4] Separated the argument examples and included explanations of what they accomplish --- TerminalDocs/command-line-arguments.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/TerminalDocs/command-line-arguments.md b/TerminalDocs/command-line-arguments.md index 9275c26c..48492f0e 100644 --- a/TerminalDocs/command-line-arguments.md +++ b/TerminalDocs/command-line-arguments.md @@ -56,8 +56,15 @@ Commands may vary slightly depending on which command line you're using. To start an instance of Windows Terminal and have it execute a command, call `wt.exe` followed by your command. -```cmd +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 and 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?view=powershell-7.1) 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 ``` From f7a5ef86cf34e3a5a9a05b20569f9aba6bb52360 Mon Sep 17 00:00:00 2001 From: Matt Wojciakowski Date: Fri, 30 Apr 2021 12:19:11 -0700 Subject: [PATCH 3/4] fix typo --- TerminalDocs/command-line-arguments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TerminalDocs/command-line-arguments.md b/TerminalDocs/command-line-arguments.md index 48492f0e..17f5cbec 100644 --- a/TerminalDocs/command-line-arguments.md +++ b/TerminalDocs/command-line-arguments.md @@ -56,7 +56,7 @@ Commands may vary slightly depending on which command line you're using. 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 and IP address: +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 From 33e3923baa618f22f03540dda8de6aa5e9f955a9 Mon Sep 17 00:00:00 2001 From: Matt Wojciakowski Date: Fri, 30 Apr 2021 12:29:03 -0700 Subject: [PATCH 4/4] remove version from url --- TerminalDocs/command-line-arguments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TerminalDocs/command-line-arguments.md b/TerminalDocs/command-line-arguments.md index 17f5cbec..739ab371 100644 --- a/TerminalDocs/command-line-arguments.md +++ b/TerminalDocs/command-line-arguments.md @@ -62,7 +62,7 @@ Here's an example of calling Windows Terminal to pass a [ping](https://docs.micr 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?view=powershell-7.1) command, and opening another new tab with Windows Command Prompt open to the `/k` directory: +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