Skip to content
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

Allow the user to "Pin" tabs #5969

Open
zadjii-msft opened this issue May 18, 2020 · 12 comments
Open

Allow the user to "Pin" tabs #5969

zadjii-msft opened this issue May 18, 2020 · 12 comments
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Milestone

Comments

@zadjii-msft
Copy link
Member

With #5787 merging soon, we'll be able to have compact tabs, the same size as "pinned" tabs in lots of browsers.

We should add a context menu option to let users pin tabs as well. When tabs are pinned, they'd move to the start of the list of tabs, to the left of the test of the tabs. We'd probably need to have different lists for pinned vs normal tabs.

Trickily, pinned tabs could only be reordered within the range of the pinned tabs - so it can't be [pinned, pinned, normal, pinned, normal] tab. That might be tricky to pull off.

A follow-up could be linked to #961 where the pinned tabs are re-started, but not the unpinned ones. I think this is kinda similar to how browsers handle pinned tabs. We'd need to reconcile this with #756 - If the user has tabs pinned, then do those re-open, and the startup configuration the user specifies? We'd want to have a comprehensive story before we start on either story.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 18, 2020
@DHowett DHowett added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels May 18, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 18, 2020
@DHowett DHowett added this to the Terminal v2.0 milestone May 18, 2020
@DHowett
Copy link
Member

DHowett commented May 18, 2020

Triaged tentatively 2.0

@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label May 18, 2020
@electronic-dk
Copy link

electronic-dk commented May 19, 2020

I have small question: is this going to be implemented in Terminal or is it expected to update to a future tab control version which supports this functionality in scope of this ticket?

@zadjii-msft
Copy link
Member Author

In my opinion, it certainly makes sense to just have it implemented in the TabView itself, but we'd have to work with @stmoy and @teaP on that to see if this would make the cut for inclusion in a future MUX release.

@catthehacker
Copy link

If Terminal is going the "browser design" route, it would be nice to make it a bit more customizable (Firefox is nice example here) where we could move some things around, e.g.: add spacer, move menu from one side to the other
image
Default Firefox
image

@stmoy
Copy link

stmoy commented Jun 30, 2020

@zadjii-msft - I agree that TabView should enable this scenario, though I don't think it'd have the "pin tab" behavior built-in. For example, I wouldn't expect TabView to save the pinned tabs if the app closes and opens again - it'd be the responsibility of the app to maintain that state.

@chingucoding introduced compact sized tabs in 2.4, but they affect the entire TabView. IIRC the width setting is not settable on the individual tab items, so that'd probably be the feature that TabView would need to expose. Since the compact sizing template is included with the TabView now, I wonder if it'd be possible to hack together a proof of concept for tab pinning; @chingucoding @teaP - thoughts?

@marcelwgn
Copy link
Contributor

While the TabView maintains the "compact/non compact" setting, every TabViewItem is aware whether it is in Compact mode or not (which is also why #6670 was needed). That said, this knowledge of compact/not compact is only available internally and not a public API. Having specific items have different sizing behavior as others would make layouting quite difficult.

Regarding a proof of concept for tab pinning would be the question whether it can be done inside the WinUI repo where we have access to internal APIs or whether it should be in the terminal code base. The latter case will probably get a bit difficult as you would need to try to revert any sizing behavior the TabView and its items are trying to keep up. But theoretically, mocking pinned tabs could work with a bit of VisualStateManager fiddling.

PS: Thanks for the ping @stmoy

@teaP
Copy link

teaP commented Jul 1, 2020

If we did pinned tabs, they would have to be in their own list; it wouldn't just be an ordering thing. My guess is that Terminal could get pretty close by simply having two TabViews next to each other (minus, probably, some layout issues). It also wouldn't be too hard to put together a proof of concept where TabView handles it internally.

@ADTC
Copy link

ADTC commented Jul 23, 2021

What is the timeline for this, please? It would solve another issue for me.

I have tabs that are permanently running processes (in foreground so I can see the logs, restart as needed, etc.). Right now, if I accidentally hit the X button, the tab kills the process immediately without any warning (see #5301). With a pinned tab, I wouldn't have the chance to accidentally close it anymore, since the tab would only have the width of the icon and not have the close button anymore.

Also, it would free up space on the tab bar for non-pinned tabs that I temporarily open for issuing ad-hoc commands. Right now, the tabs running foreground processes take up so much space without pinning, that the additional tabs just get crushed up on the tab bar.

@zadjii-msft
Copy link
Member Author

@ADTC There's no timeline for this currently - it's simply on the "backlog". We'd absolutely accept an external contribution for this feature, but we're likely not getting to this on this side of 2022.

I think this comment has a great idea of how to start the work on this. The trick is that we currently do a lot of work on tabs by their index in the list - if there were two separate lists of tabs, then that math would get more confusing.

@Exerosis
Copy link

I propose that an initial version of pinning be released but keep the indexing the same. For example you might have 3 pinned tabs followed by an unpinned tab and then another pinned tab. I'm not sure about most people's use cases; for me, it's about not accidentally closing important terminals, not really about organizing tabs.

@pfeileon
Copy link

pfeileon commented Feb 29, 2024

I propose that an initial version of pinning be released but keep the indexing the same. For example you might have 3 pinned tabs followed by an unpinned tab and then another pinned tab. I'm not sure about most people's use cases; for me, it's about not accidentally closing important terminals, not really about organizing tabs.

I wouldn't call that pinning but locking. Imho that's a different feature.

@Exerosis
Copy link

I propose that an initial version of pinning be released but keep the indexing the same. For example you might have 3 pinned tabs followed by an unpinned tab and then another pinned tab. I'm not sure about most people's use cases; for me, it's about not accidentally closing important terminals, not really about organizing tabs.

I wouldn't call that pinning but locking. Imho that's a different feature.

Perhaps, but if pinning is difficult to implement and locking is not then it might be a good first step that satisfies at least some people. (if all I could do was lock tabs on edge/chrome I would still be happy with the feature)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

10 participants