[PR #4023] [MERGED] Add support for commandline args to wt.exe #25602

Open
opened 2026-01-31 09:10:33 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4023
Author: @zadjii-msft
Created: 12/19/2019
Status: Merged
Merged: 1/27/2020
Merged by: @undefined

Base: masterHead: dev/migrie/f/607-handle-args


📝 Commits (10+)

  • 1d1e6a6 Add all TerminalApp bits from old branch
  • f1f9ad4 move existing tests over. AppLogic is now responsible for parsing commandlines
  • 299f435 some light cleanup of test code, parsing code
  • a891b25 Add more tests for parsing commandline args
  • 703f192 Encapsulate Cmdline a bit better ; more tests
  • 9db1d0b Add a test for escaping delimiters, even if it's not supported yet
  • af34e99 Merge branch 'master' into dev/migrie/f/cli11-commandline
  • c8531ec Move AppCommandline into two files
  • 1fd1de8 trying to find un-escaped delimiters but this seems like it only gets one
  • dfbecac well this gets the tricky tests to pass

📊 Changes

30 files changed (+10089 additions, -53 deletions)

View changed files

dep/CLI11/CLI11.hpp (+7821 -0)
dep/CLI11/README.md (+5 -0)
doc/user-docs/UsingCommandlineArguments.md (+156 -0)
src/cascadia/LocalTests_TerminalApp/CommandlineTest.cpp (+991 -0)
📝 src/cascadia/LocalTests_TerminalApp/TerminalApp.LocalTests.vcxproj (+10 -1)
📝 src/cascadia/LocalTests_TerminalApp/pch.h (+3 -0)
src/cascadia/TerminalApp/AppCommandlineArgs.cpp (+609 -0)
src/cascadia/TerminalApp/AppCommandlineArgs.h (+97 -0)
📝 src/cascadia/TerminalApp/AppLogic.cpp (+18 -0)
📝 src/cascadia/TerminalApp/AppLogic.h (+3 -9)
📝 src/cascadia/TerminalApp/AppLogic.idl (+5 -2)
src/cascadia/TerminalApp/Commandline.cpp (+39 -0)
src/cascadia/TerminalApp/Commandline.h (+46 -0)
📝 src/cascadia/TerminalApp/Tab.cpp (+1 -1)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+146 -8)
📝 src/cascadia/TerminalApp/TerminalPage.h (+9 -2)
📝 src/cascadia/TerminalApp/TerminalPage.idl (+3 -0)
📝 src/cascadia/TerminalApp/lib/TerminalAppLib.vcxproj (+14 -1)
📝 src/cascadia/TerminalApp/lib/pch.h (+9 -1)
📝 src/cascadia/TerminalControl/TermControl.cpp (+1 -0)

...and 10 more files

📄 Description

Summary of the Pull Request

Adds support for commandline arguments to the Windows Terminal, in accordance with the spec in #3495

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

🛑 STOP 🛑 - have you read #3495 yet? If you haven't, go do that now.

This PR adds support for three initial sub-commands to the wt.exe application:

  • new-tab: Used to create a new tab.
  • split-pane: Used to create a new split.
  • focus-tab: Moves focus to another tab.

These commands are largely POC to prove that the commandlines work. They're not totally finished, but they work well enough. Follow up work items will be filed to track adding support for additional parameters and subcommands

Important scenarios added:

Validation Steps Performed

  • Ran tests
  • Played with it a bunch

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4023 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 12/19/2019 **Status:** ✅ Merged **Merged:** 1/27/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/migrie/f/607-handle-args` --- ### 📝 Commits (10+) - [`1d1e6a6`](https://github.com/microsoft/terminal/commit/1d1e6a6ffede53aea2ba393092a98095aaea4f5e) Add all TerminalApp bits from old branch - [`f1f9ad4`](https://github.com/microsoft/terminal/commit/f1f9ad4c1bbbbe3f0f3e171b266e21fea862f7a1) move existing tests over. AppLogic is now responsible for parsing commandlines - [`299f435`](https://github.com/microsoft/terminal/commit/299f435e08df872449a2b5cdd3119aa89b2aadd2) some light cleanup of test code, parsing code - [`a891b25`](https://github.com/microsoft/terminal/commit/a891b25bf8a96bfafb1387ed16b2421ef16767dd) Add more tests for parsing commandline args - [`703f192`](https://github.com/microsoft/terminal/commit/703f192fa0c22c24b58dd607005123f5f4401adc) Encapsulate Cmdline a bit better ; more tests - [`9db1d0b`](https://github.com/microsoft/terminal/commit/9db1d0ba208eba898adf61c856fe8444dbb66287) Add a test for escaping delimiters, even if it's not supported yet - [`af34e99`](https://github.com/microsoft/terminal/commit/af34e9930b53866f98bfc37fbed8f89309215a6b) Merge branch 'master' into dev/migrie/f/cli11-commandline - [`c8531ec`](https://github.com/microsoft/terminal/commit/c8531ec360344a1a8594c931001afc88fa9f07ee) Move AppCommandline into two files - [`1fd1de8`](https://github.com/microsoft/terminal/commit/1fd1de8c8c690b523bc08fbe19e6760aa5c8be9b) trying to find un-escaped delimiters but this seems like it only gets one - [`dfbecac`](https://github.com/microsoft/terminal/commit/dfbecac0f551f2c0ff77b2f61ef6d78d5c77eac7) well this gets the tricky tests to pass ### 📊 Changes **30 files changed** (+10089 additions, -53 deletions) <details> <summary>View changed files</summary> ➕ `dep/CLI11/CLI11.hpp` (+7821 -0) ➕ `dep/CLI11/README.md` (+5 -0) ➕ `doc/user-docs/UsingCommandlineArguments.md` (+156 -0) ➕ `src/cascadia/LocalTests_TerminalApp/CommandlineTest.cpp` (+991 -0) 📝 `src/cascadia/LocalTests_TerminalApp/TerminalApp.LocalTests.vcxproj` (+10 -1) 📝 `src/cascadia/LocalTests_TerminalApp/pch.h` (+3 -0) ➕ `src/cascadia/TerminalApp/AppCommandlineArgs.cpp` (+609 -0) ➕ `src/cascadia/TerminalApp/AppCommandlineArgs.h` (+97 -0) 📝 `src/cascadia/TerminalApp/AppLogic.cpp` (+18 -0) 📝 `src/cascadia/TerminalApp/AppLogic.h` (+3 -9) 📝 `src/cascadia/TerminalApp/AppLogic.idl` (+5 -2) ➕ `src/cascadia/TerminalApp/Commandline.cpp` (+39 -0) ➕ `src/cascadia/TerminalApp/Commandline.h` (+46 -0) 📝 `src/cascadia/TerminalApp/Tab.cpp` (+1 -1) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+146 -8) 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+9 -2) 📝 `src/cascadia/TerminalApp/TerminalPage.idl` (+3 -0) 📝 `src/cascadia/TerminalApp/lib/TerminalAppLib.vcxproj` (+14 -1) 📝 `src/cascadia/TerminalApp/lib/pch.h` (+9 -1) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+1 -0) _...and 10 more files_ </details> ### 📄 Description ## Summary of the Pull Request Adds support for commandline arguments to the Windows Terminal, in accordance with the spec in #3495 ## References * Original issue: #607 * Original spec: #3495 ## PR Checklist * [x] Closes #607 * [x] I work here * [x] Tests added/passed * [ ] We should probably add some docs on these commands * [x] The spec (#3495) needs to be merged first! ## Detailed Description of the Pull Request / Additional comments 🛑 **STOP** 🛑 - have you read #3495 yet? If you haven't, go do that now. This PR adds support for three initial sub-commands to the `wt.exe` application: * `new-tab`: Used to create a new tab. * `split-pane`: Used to create a new split. * `focus-tab`: Moves focus to another tab. These commands are largely POC to prove that the commandlines work. They're not totally finished, but they work well enough. Follow up work items will be filed to track adding support for additional parameters and subcommands Important scenarios added: * `wt -d .`: Open a new wt instance in the current working directory #878 * `wt -p <profile name>`: Create a wt instance running the given profile, to unblock #576, #1357, #2339 * `wt ; new-tab ; split-pane -V`: Launch the terminal with multiple tabs, splits, to unblock #756 ## Validation Steps Performed * Ran tests * Played with it a bunch --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:10:33 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25602