-
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
Feature Request: Context Menu for Tabs #1912
Comments
We almost certainly want to do this. @carlos-zamora indicated an interest in this in April 😄 |
The sooner this can be added, with the single close command - would be appreciated. Once there is a context menu there, new things can be added over time. |
Just installed Terminal to try it out and this was the very first thing I noticed... along side having to edit a JSON file for the settings. |
Another nice-to-have item for a tab's context menu would be to restart/reload the tab. This is one feature I use heavily in ConEmu currently. Being able to bind that to a keyboard shortcut would also be fantastic. |
Rename via double-click/key-binding would also be very nice. The new tabTitle option is already useful but sometimes it could be helpful to quickly rename a tab. |
Also it may be useful for executing custom commands for profiles. |
Another request from #1000: Actions for "Split Vertical [|]" and "Split Horizontal [-]", then with sub-menus for which profile to split with. |
This thread seems to be getting muddled with ancillary requests not specific to the title. Please stay on target with the original request. Make separate requests as relevant. That that end, is there any movement on this request (Feature Request: Context Menu for Tabs) |
When there's progress, we'll make sure to post in here 😉. #3789 will add a context menu that we can use, then it's just on us to add more features to that flyout. |
I'm pretty sure it's relevant to a "context menu for tabs", since it literally adds a context menu to tabs: We're not planning on having a specific other PR for just adding a context menu to the tabs while this PR (#3789) is active. Typically, we like to use "feature" issues to track larger buckets of work that might span multiple PRs, and "task" issues to track work that could be done as an individual PR. So in this case, this "feature" encapsulates all the context menu entries, while
Are all reasonable sub-tasks that should be incorporated into a complete design. Obviously, this is all fairly open to change as we work on it, but those are rough estimates of how we track issues on our repo. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thanks for the suggestion! I think there's a lot of good suggestions in this thread, and I'd rather not muddle #3789 with ancillary requests. That PR is a good atomic PR that adds exactly one feature, and adding more requests to it would further delay a PR that's already overdue. Once that PR is merged, we'll use this thread as the master thread for all the follow-up tasks to add to the context menu. |
The context menu should also have a |
So the only reason I'm reluctant to just slam that feature in now is the following question: what happens when the tab has multiple panes in it? The "duplicateTab" keybinding currently only duplicates the active pane into a new tab. It was also authored before panes were really a thing. So maybe we'll need to do two things here:
|
Can I take up this issue? |
Go right ahead! Right now the context menu is being constructed in Tab::_CreateContextMenu. Honestly, the hardest part might just be wiring up the Then it's just a matter of creating an Which action(s) were you thinking of adding to the context menu? |
I was thinking of adding "Close all tabs to the right" to the context menu. I went through the file mentioned by you and I have a fair idea to solve this issue. Under CreateContextMenu() in |
Yea, that's a little bit of the challenge with that action. Right now, I think the
Unfortunately, that doesn't really help you right now. I might need to roll that action (or a variation) together before this is actually possible... |
@RahulRavishankar I threw together a PR for the actions that you'll probably need over in #7176. You'd still need some way for a Tab to figure out what index it is, but that shouldn't be that hard. Hope that helps! |
## Summary of the Pull Request Adds support for two actions, `closeOtherTabs` and `closeTabsAfter`. Both these actions accept an `index` parameter. * `closeOtherTabs`: Close tabs other than `index` * `closeTabsAfter`: Close tabs after `index` (This is also "Close tabs to the right") ## References * This PR is being made to unblock @RahulRavishankar in #1912 ## PR Checklist * [x] I work here * [ ] Tests added/passed * [x] Requires documentation to be updated * [ ] We should file an issue for "add an `index` param to `closeTab`" to add similar support to the close tab action * [ ] We should file an issue for "make the `index` param to `closeOtherTabs`, `closeTabsAfter` optional" to make them both work on the _active_ tab when there's no `index` provided ## Validation Steps Performed * _Verified that_ closing all tabs when I have the `index`'th tab selected _works as expected_ * _Verified that_ closing all tabs when I have a tab other than the `index`'th tab selected _works as expected_ * _Verified that_ closing tabs to the right when I have the `index`'th tab selected _works as expected_ * _Verified that_ closing tabs to the right when I have a tab other than the `index`'th tab selected _works as expected_ - This one has one caveat: for whatever reason, if you run this action when the tab that's currently focused is _before_ the `index` param, then the tabs will expand to fill the entire width of the tab row, until you mouse over them. Probably has something to do with tabs not resizing down until there's a mouse exit event.
## Summary of the Pull Request⚠️ This spec has been moved from #6902. That version was branched off the new tab menu customization, and had a terribly convoluted git history. After discussion with the team, we've decided that it's best that this spec is merged atomically _first_, and used as the basis for #5888, as opposed to the other way around. > This document is intended to serve as an addition to the [Command Palette Spec], > as well as the [New Tab Menu Customization Spec]. > > As we come to rely more on actions being a mechanism by which the user defines > "do something in the Terminal", we'll want to make it even easier for users to > re-use the actions that they've already defined, as to reduce duplicated json as > much as possible. This spec proposes a mechanism by which actions could be > uniquely identifiable, so that the user could refer to bindings in other > contexts without needing to replicate an entire json blob. > ## PR Checklist * [x] Specs: #6899 * [x] References: #1571, #1912, #3337, #5025, #5524, #5633 * [x] I work here ## Detailed Description of the Pull Request / Additional comments _\*<sup>\*</sup><sub>\*</sub> read the spec <sub>\*</sub><sup>\*</sup>\*_ [Command Palette Spec]: https://github.com/microsoft/terminal/blob/master/doc/specs/%232046%20-%20Command%20Palette.md [New Tab Menu Customization Spec]: https://github.com/microsoft/terminal/blob/master/doc/specs/%231571%20-%20New%20Tab%20Menu%20Customization.md
Can those menu items be grayed out if there are no tabs that would be closed by them? I suppose that can be done as a separate feature that applies to the command palette as well. |
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Add a "Close..." option to the tab context menu, with nested entries to close tabs to the right and close other tabs (actions already available) ![immagine](https://user-images.githubusercontent.com/1140981/94178005-c7e03600-fe9a-11ea-9f87-c6f4895d4cf3.png) <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References #1912 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #5524 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments First contribution 🙂 Tried to follow some suggestions from #1912 (comment) <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Adds the Split Tab option to the tab context menu. Clicking this option will `auto` split the active pane of the tab into a duplicate pane. Clicking on an unfocused tab and splitting it will bring that tab into focus and split its active pane. We could make this a flyout from the context menu to let people choose horizontal/vertical split in the future if it's requested. I'm also wondering if this should be called Split Pane instead of Split Tab? <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References #1912 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #5025 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments https://user-images.githubusercontent.com/48369326/127691919-aae4683a-212a-4525-a0eb-a61c877461ed.mp4 <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed
You know, the fundamental work for this has been done (and shipped for quite some time). I don't really think we need to keep this open to track the various individual items of the menu any longer. Thanks all! |
Context Menu for Tabs
Useful for now, whilst the Tab Bar is in an incomplete state, but will also be useful in a finished version. Each Tab should have a Context Menu with a Close command, as well as eventually, options for renaming the Profile/Tab Title, and changing the TabWidth behaviour.
For now, the Tab Title Text can be so long, you need to scroll with the mouse wheel to get to the close button on some tabs, so having a right click option would help for now.
team notes
The text was updated successfully, but these errors were encountered: