[PR #8315] Fix combining wt args and "wt new-tab" args in implicit context #27167

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

Original Pull Request: https://github.com/microsoft/terminal/pull/8315

State: closed
Merged: Yes


Currently when implicit tab command is specified (i.e., we have
parameters for new-tab, but don't have the explicit subcommand name) we
fallback to parsing the entire arg list as new tab command.

However, if we also have a launch profile (or anything else that might in
the future belong to the upper scope) it is passed as a parameter to the
new tab command, failing the parsing.

The idea behind my solution is to run the parser as a prefix command -
i.e., as long as we succeed to parse [options] / [subcommand] we will
parse them (populating the fields like a launch mode), but once we will
discover something unfamiliar, like profile, we will know that the
prefix is over and will handle the remaining suffix as a new tab
command.

PR Checklist

  • CLA signed.
  • Tests added/passed
  • I've discussed this with core contributors already.

Validation Steps Performed

  • UT added
  • Manual run of different option

Closes #7318

**Original Pull Request:** https://github.com/microsoft/terminal/pull/8315 **State:** closed **Merged:** Yes --- Currently when implicit tab command is specified (i.e., we have parameters for new-tab, but don't have the explicit subcommand name) we fallback to parsing the entire arg list as new tab command. However, if we also have a launch profile (or anything else that might in the future belong to the upper scope) it is passed as a parameter to the new tab command, failing the parsing. The idea behind my solution is to run the parser as a prefix command - i.e., as long as we succeed to parse [options] / [subcommand] we will parse them (populating the fields like a launch mode), but once we will discover something unfamiliar, like profile, we will know that the prefix is over and will handle the remaining suffix as a new tab command. ## PR Checklist * [x] CLA signed. * [x] Tests added/passed * [x] I've discussed this with core contributors already. ## Validation Steps Performed * UT added * Manual run of different option Closes #7318
claunia added the pull-request label 2026-01-31 09:20:23 +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#27167