Add a configuration object for focused vs unfocused state #4258

Open
opened 2026-01-30 23:42:20 +00:00 by claunia · 0 comments
Owner

Originally created by @zadjii-msft on GitHub (Oct 4, 2019).

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

Originally created by @zadjii-msft on GitHub (Oct 4, 2019). 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? ```json "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. <sup>[1]</sup> ###### [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. <hr> 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. <hr> 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4258