-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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 a move-focus
subcommand
#8546
Conversation
…hort-command-names
…aybe-move-focus # Conflicts: # src/cascadia/TerminalApp/AppCommandlineArgs.cpp # src/cascadia/TerminalApp/AppCommandlineArgs.h
# Conflicts: # src/cascadia/TerminalApp/AppCommandlineArgs.h # src/cascadia/TerminalApp/Resources/en-US/Resources.resw
…m _before_ opening the PR
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.
Besides the question inline - shouldn't we also update _resetStateToDefault
void AppCommandlineArgs::_buildMoveFocusParser() | ||
{ | ||
_moveFocusCommand = _app.add_subcommand("move-focus", RS_A(L"CmdMoveFocusDesc")); | ||
_moveFocusShort = _app.add_subcommand("mf", RS_A(L"CmdMFDesc")); |
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.
@zadjii-msft - dumb question.. let's say we introduce "m" for minimized, and then I write -mf. What will the command line do: minimized focus or move focus? 😄
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.
Presumably, wt -mf sp ; mf left
will still work, because the --minimizeFocus
arg will be an option, not a subcommand. I'd think that CLI11 should be able to differentiate between the -mf
and mf
args. If not, that would definitely be an upstream bug 😄
Already done, on L532 😄 |
Yeah. Weird - I checked few times, as I was surprised you will forget after doing so few days ago for focus tab. In any case it is there and looks lovely. |
Co-authored-by: Carlos Zamora <[email protected]>
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: |
## Summary of the Pull Request Adds support for the `move-focus` subcommand to `wt.exe`. This subcommand works _exactly_ like `moveFocus(up|down|left|right)`. ## References * Will surely conflict with microsoft#8183 * Is goodness even in the world where microsoft#5464 exists ## PR Checklist * [x] Closes microsoft#6580 * [x] I work here * [x] Tests added/passed * [x] Docs PR: MicrosoftDocs/terminal#209 ## Detailed Description of the Pull Request / Additional comments Bear with me, I wrote this before paternity leave, so code might be a bit stale. Oddly, after startup, this _does not_ leave the focus on the pane you moved to. If you `move-focus` during startup, at the end of startup, we'll still focus a _random_ pane. This is because the terminal still auto-focus a TermControl when it's done with layout. While we'll maintain the active control just fine during the startup, at the end of startup, all the controls will complete layout in a random order. This is no different than the startup right now. `wt sp ; sp ; sp` will focus a random pane at the end. This is left for a future someone to fix This is also subject to microsoft#2398 / microsoft#4692. Moving in a direction isn't _totally_ reliable currently. `focus-pane -t ID` will certainly be more reliable, but this will work in the meantime? ## Validation Steps Performed Opened probably 100 terminals, confirmed that the layout was always correct. Final focused pane was random, but the layout was right.
Summary of the Pull Request
Adds support for the
move-focus
subcommand towt.exe
. This subcommand works exactly likemoveFocus(up|down|left|right)
.References
focus-pane
subcommand #5464 existsPR Checklist
move-focus
subcommand #6580move-focus
subcommand MicrosoftDocs/terminal#209Detailed Description of the Pull Request / Additional comments
Bear with me, I wrote this before paternity leave, so code might be a bit stale.
Oddly, after startup, this does not leave the focus on the pane you moved to. If you
move-focus
during startup, at the end of startup, we'll still focus a random pane. This is because the terminal still auto-focus a TermControl when it's done with layout. While we'll maintain the active control just fine during the startup, at the end of startup, all the controls will complete layout in a random order.This is no different than the startup right now.
wt sp ; sp ; sp
will focus a random pane at the end. This is left for a future someone to fixThis is also subject to #2398 / #4692. Moving in a direction isn't totally reliable currently.
focus-pane -t ID
will certainly be more reliable, but this will work in the meantime?Validation Steps Performed
Opened probably 100 terminals, confirmed that the layout was always correct. Final focused pane was random, but the layout was right.