-
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
Drag & Drop Tabs to create a Pane #4587
Comments
In this context, hard to discover means also "easy to forget" |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
I thought about filing a separate issue but decided to comment on this one instead. In the web browser world it is now assumed that users can drag tabs out of windows, back into windows, etc. This tearing off of tabs is an essential and elegant tool. The Windows Terminal should copy this UI paradigm. That is, in addition to being able to drag tabs to rearrange their order, and drag tabs to create panes, users should also be able to drag panes to other terminal windows, or drag them out to create new terminal windows. |
I actually really like the WPF/Visual Studio tab hover/drag/drop controls. I'd love to see us implement something like that. |
(I thought they were obnoxious at first, but now that I'm older and either more or less opinionated, I find them "usable" 😁) |
@randomascii I realized I never saw your comment. We've got an issue tracking tab tearoff/window merging, and we're evaluating it for the post-v1 timeframe. That's over in #1256! |
Just to add my +1, I could have sworn that I saw that you could split tabs - I spent a long time trying to figure out how to do it and gave up. Only figured out how to do this when I read the settings file and saw there was a shortcut for it. I also like VS approach and was my first attempt at splitting panels (note: I work on VS, I am biased). |
From @schuelermine in #6291:
|
I would very much prefer if panes also had a tab indicator, maybe grouping panes in consecutive tabs marked with the same color to mark a pane group, or a single "fatter" tab with some markings from each contained pane. Clicking on the "sub-tab" could directly bring that pane to focus. But I can work with just drag-drop-able tabs / panes. 😁 |
@zadjii-msft I've made a slightly better version of that mockup, you might want to replace that image with this one: https://drive.google.com/file/d/1h6YLEPTmdB0woqNMep-npFMqTEJGY3HX/view?usp=sharing |
Please don't forget the drag out to create new window, like browser tabs do. It's very quickly and easy when you have more than one screen. |
I'd like to vote this feature up by describing important use-case. |
I would like to echo @luzhkovvv's comment. This would be very useful as I frequently find myself starting multiple tabs initially to get stuff kicked off, and then moving more into a "monitoring" mode, where I'd like to move the existing sessions into panes so I can see them all at once. I'd be willing to contribute some coding time to make this happen if it is approved and up for grabs. |
<!-- 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 functionality to move a pane to another tab. If the tab index is greater than the number of current tabs a new tab will be created with the pane as its root. Similarly, if the last pane on a tab is moved to another tab, the original tab will be closed. This is largely complete, but I know that I'm messing around with things that I am unfamiliar with, and would like to avoid footguns where possible. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References #4587 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #7075 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [x] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [x] 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 Things done: - Moving a pane to a new tab appears to work. Moving a pane to an existing tab mostly works. Moving a pane back to its original tab appears to work. - Set up {Attach,Detach}Pane methods to add or remove a pane from a pane. Detach is slightly different than Close in that we want to persist the tree structure and terminal controls. - Add `Detached` event on a pane that can be subscribed to to remove other event handlers if desired. - Added simple WalkTree abstraction for one-off recursion use cases that calls a provided function on each pane in order (and optionally terminates early). - Fixed an in-prod bug with closing panes. Specifically, if you have a tree (1; 2 3) and close the 1 pane, then 3 will lose its borders because of these lines clearing the border on both children https://github.com/microsoft/terminal/blob/main/src/cascadia/TerminalApp/Pane.cpp#L1197-L1201 . To do: - Right now I have `TerminalTab` as a friend class of `Pane` so I can access some extra properties in my `WalkTree` callbacks, but there is probably a better choice for the abstraction boundary. Next Steps: - In a future PR Drag & Drop handlers could be added that utilize the Attach/Detach infrastructure to provide a better UI. - Similarly once this is working, it should be possible to convert an entire tab into a pane on an existing tab (Tab::DetachRoot on original tab followed by Tab::AttachPane on the target tab). - Its been 10 years, I just really want to use concepts already. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Manual testing by creating pane(s), and moving them between tabs and creating new tabs and destroying tabs by moving the last remaining pane.
Also one use case for this would be to reorganize the position of existing tabs for time when you badly positioned then and there is too much info on one pane horizontally like a running a "docker ps" or a "kubectl get pods -o wide" And we get If I am not mistaken, the Terminator terminal already permit this, could be useful looking at their code for reference. https://terminator-gtk3.readthedocs.io/en/latest/gettingstarted.html |
If you're looking for some prior-art to guide the implementation I think the JupyterLab experience is an excellent (and battle-tested) UI/UX. The tab drag & drop functionality is provided by the https://lumino.readthedocs.io/en/latest/examples/dockpanel/index.html |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
The lack of this functionality is incredibly frustrating when you are setting up something in one tab, pop a new one to do something else and want to be able to watch them side-by-side. The non-intuitive, non-standard 'well right click and split tabs first' would be wonderful except nothing else does this. This is my biggest issue and makes me want to use a different terminal emulator every time I encounter it. |
by the way, if this were to be implemented, where would be the "drag region"? like, we don't have currently anything in the terminal that is draggable or is a panel indicator in each panel, as they have a clean design and I think they should remain that way. Any suggestions? |
Dragging and dropping a tab to create a pane is pretty straightforward - we could have some sort of overlay like VS or VSCode. Dragging a Pane to somewhere else would probably require #4717 first, so that there's something attached to the pane to drag. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
yea, dragging a tab is ok, my point was the pane part. personally i think it is a little ugly the idea of pane title because i like how the windows terminal is "clean" compared to others like terminator, but we also need something draggable |
Here's an idea I want to share, what can be done instead of permanently visible drag handles: So, by default we have I suggest a While alt-shift-control is down, we get
|
I like this idea @klkvsk , and if we combine this with the lumino demo that @dhirschfeld mentioned would be perfect. https://lumino.readthedocs.io/en/latest/examples/dockpanel/index.html |
Description of the new feature/enhancement
The current way of splitting panes using written commands or shortcuts is awesome but difficult to discover.
There is already some drag & drop support for reordering tabs. It would be awesome to be able to drag & drop a tab to split a pane in the previous tab. An exemple of user interaction sequence:
Optionally, show a popup saying "Want to automate that ? click here to copy an automation script to your clipboard", which would copy a script that would do the same thing.
Proposed technical implementation details (optional)
Well, I am sure it is possible to do that by writing some code :)
The text was updated successfully, but these errors were encountered: