terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Add `tab.closeButton: activeOnly`

Open zadjii-msft opened this issue 3 years ago • 1 comments
trafficstars

TabView is a part of WinUI, and that code is available over at https://github.com/microsoft/microsoft-ui-xaml/

I want to know if it's even possible on the current version of TabView to actualize what that enum would represent?

Hm. https://github.com/microsoft/terminal/blob/a9c3b7724c05a0da059c4a0433ea446f8e19cbff/src/cascadia/TerminalApp/TerminalPage.cpp#L2740-L2772

  • We could take that, turn that into a method.
  • Call that method every time the active tab changes...
  • ... or the set of tabs changes.
  • Get rid of all the calls to _updateTabCloseButton, cause that only updates a single tab.
  • Add logic in that method
    • Inside the loop, if the mode is ActiveOnly, and the tab is active, then IsClosable(true). else false
    • Outside the loop, set CloseButtonOverlayMode to Auto, probably a sensible default.

That sounds like it would work on paper. Wanna file a PR? 😄

Originally posted by @zadjii-msft in https://github.com/microsoft/terminal/issues/3335#issuecomment-1203867172

zadjii-msft avatar Aug 04 '22 15:08 zadjii-msft

I have a question,for:

Call that method every time the active tab change ... or the set of tabs changes.

what would be the best way to implement this(as in check which tab(s) are active)?

shourya5 avatar Aug 07 '22 16:08 shourya5