-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for commandline args to wt.exe
#4023
Conversation
…tbase! When we startup, we currently have a `Title`, because we always have a Tab. With commandline args, we'll sometimes _not_ have a tab immediately. In that case, this would crash
…mething provided by a commandline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally got through all of it. Here's a few comments. This thing is awesome!
Don't feel comfortable approving it until I actually download the branch and play with it a bit. I can do that once Seattle Snowpocalypse 2020 ends and I get back into the office (assuming it isn't merged by then).
Alright, got a chance to play with it. Found a few issues:
When executed from CMD, TermA still accepts input. But upon closing the new terminal instance, the same exception is thrown.
Is there any way to fix this? ☹ |
@carlos-zamora:
Also, I'm not sure any execution aliases work in wsl. |
Yes, that’s because powershell 6 cannot detect app execution aliases for their subsystem. |
Derp. That's what I get for being in accessibility-land for so long haha.
But I thought one of the cool things with WSL was that you can just run things like "notepad.exe" or any windows executable and it just works. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits, but not enough to blockk
if (arg.find(" ") != std::string::npos) | ||
{ | ||
fullCommandlineBuffer += "\""; | ||
fullCommandlineBuffer += arg; | ||
fullCommandlineBuffer += "\""; | ||
} | ||
else | ||
{ | ||
fullCommandlineBuffer += arg; | ||
} | ||
fullCommandlineBuffer += " "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
big dislike. please file a bug on CLI11 to request a mode that lets us get everything after the first non-parameter string verbatim in the right format.
// that produces a NewTerminalArgs. | ||
struct NewTerminalSubcommand | ||
{ | ||
CLI::App* subcommand; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't 100% understand how a subcommand has-a subcommand, but I am willing to accept it
CLI::App* _focusTabCommand; | ||
// Are you adding a new sub-command? Make sure to update _noCommandsProvided! | ||
|
||
CLI::Option* _horizontalOption; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these seem unusually global
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(to all Args)
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
this works around #756 with the following syntax less then ideal but it gets it done shame there is not a good way to simply just tic a box and have this be the default I should not need to use batch files to launch the terminal thats the entire point of having a new terminal lol we are circling around this issue really getting support for simply having some default options that don't require digging around in a json file would close three issue and probly more I don't know about I don't think this should wait for post 1.0 this is sorta a killer feature most Linux terminals support being configured as such and it would help push people to use windows terminal which is the end game here |
Summary of the Pull Request
Adds support for commandline arguments to the Windows Terminal, in accordance with the spec in #3495
References
wt.exe
#3495PR Checklist
wt.exe
#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 Starting directory no longer respected #878wt -p <profile name>
: Create a wt instance running the given profile, to unblock Feature Request: Task Bar jumplist should show items from profile #576, Draft spec for adding profiles to the Windows jumplist #1357, Feature Request Option to add profiles to the Windows Start Menu #2339wt ; new-tab ; split-pane -V
: Launch the terminal with multiple tabs, splits, to unblock Feature Request: Start with multiple tabs open #756Validation Steps Performed