Terminal: Add a configuration object for focused vs unfocused state

Created on 4 Oct 2019  路  4Comments  路  Source: microsoft/terminal

Follow up from #994.

Originally suggested by @cdmihai in #994

Hyper changes the text color. The focused pane uses a saturated, bright version of the font color, the out of focus panes use a desaturated, dark version of the font. I found that this makes it quite visually intuitive to instantly notice which pane is active. Yet the other panes are still quite readable.

Sounds like the holy grail would be to have a configuration object for pane switching features (text fonts, background colors, borders, cursor, etc) with some sensible accessible defaults.

Taking that idea and running with it, what if each profile could specify an "unfocused" state that's used when it loses focus?

    "profiles":
    [
        {
            "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
            "name": "cmd",
            "commandline": "cmd.exe",

            "colorScheme": "Solarized Dark",
            "cursorColor": "#FF00FF",
            "cursorShape": "bar",
            "fontFace": "Consolas",
            "fontSize": 12,
            "foreground": "#C0C0C0",
            "background": "#000000",

            "unfocusedState": 
            {
                "colorScheme": "Campbell",
                "cursorColor": "#888",
                "cursorShape": "emptyBox",
                "foreground": "#C0C0C0",
                "background": "#000000"
            }
        }
    ],

Presumably, backgroundImage settings would also be fine in that block.

Things I _wouldn't_ want to enable in this block:

  • Anything that causes a resize. padding, fontFace, fontSize.
  • The acrylic settings. Acrylic doesn't work when the window _isn't_ focused, and I wouldn't want people to think that it magically will if they add that setting. [1]
[1]: Technically, with split panes, they could have an unfocused control that could still have an acrylic BG, as long as the window remains focused.

I'm realizing now that this is strictly a superset of #2316, and will also resolve that one. I maybe could have just used that thread originally.


26 Mar 2020: #5130 brought up the good point that this should also include enabling the cursor to still be On, even when the control isn't focused

Area-Settings Area-TerminalControl Help Wanted Issue-Task Product-Terminal

Most helpful comment

Sure it's "just" a cosmetic thing, but isn't the new Term also about a cosmetic refresh? So for me it is totally annoying having it going totally black when not focused. Looks pretty bad und totally uneccessary.

All 4 comments

Yanking Triage -- this is a neat feature, but it does require a little bit of thinkin' about.

@coupez There's actually a bunch of other threads that have covered that discussion, but this isn't one of them. This mostly tracks controlling the appearance of an active pane vs inactive panes, when there are many panes in the same tab. For discussion on how acrylic works, see: #2326, #1886, #1747, #1546, #1505, #1099, #593, #3336, #2763, #2698, #3497

Sure it's "just" a cosmetic thing, but isn't the new Term also about a cosmetic refresh? So for me it is totally annoying having it going totally black when not focused. Looks pretty bad und totally uneccessary.

not even a hack for the Acrylic to be present when the focus is lost?

Was this page helpful?
0 / 5 - 0 ratings