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

Add a configuration object for focused vs unfocused state #3062

Closed
zadjii-msft opened this issue Oct 4, 2019 · 8 comments · Fixed by #8392
Closed

Add a configuration object for focused vs unfocused state #3062

zadjii-msft opened this issue Oct 4, 2019 · 8 comments · Fixed by #8392
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@zadjii-msft
Copy link
Member

zadjii-msft commented 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

@zadjii-msft zadjii-msft added Help Wanted We encourage anyone to jump in on these. Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. labels Oct 4, 2019
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Oct 4, 2019
@ghost ghost added the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Oct 4, 2019
@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Oct 7, 2019
@DHowett-MSFT
Copy link
Contributor

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

@zadjii-msft
Copy link
Member Author

@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

@solariz
Copy link

solariz commented Feb 26, 2020

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.

@anwar3606
Copy link

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

@reinux

This comment has been minimized.

@zadjii-msft
Copy link
Member Author

This isn't the thread to discuss whether acrylic should be enabled when the window is focused or not. There's like 11 threads I linked above that are better suited for that discussion. There's also #7158 which is tracking investigating if unfocused acrylic is possible in the Terminal. I'd ask that we re-direct this discussion to that thread, thanks.

ghost pushed a commit that referenced this issue Feb 6, 2021
<!-- 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
Spec for #3062

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [ ] Closes #xxx
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [x] Is documentation
* [ ] Schema updated.
* [x] I work here

<!-- 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
Read the spec
@zadjii-msft zadjii-msft added In-PR This issue has a related PR and removed Help Wanted We encourage anyone to jump in on these. labels Mar 25, 2021
@ghost ghost closed this as completed in #8392 Apr 8, 2021
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Apr 8, 2021
ghost pushed a commit that referenced this issue Apr 8, 2021
This pull request adds an appearance configuration object to our
settings model and app lib, allowing the control to be rendered
differently depending on its state, and then uses it to add support for
an "unfocused" appearance that the terminal will use when it's not in
focus.

To accomplish this, we isolated the appearance-related settings from
Profile (into AppearanceConfig) and TerminalSettings (into the
IControlAppearance and ICoreAppearance interfaces). A bunch of work was
done to make inheritance work.

The unfocused appearance inherits from the focused one _for that
profile_. This is important: If you define a
defaults.unfocusedAppearance, it will apply all of defaults' settings to
any leaf profile when a terminal in that profile is out of focus.

Specified in #8345 
Closes #3062
Closes #2316
@ghost
Copy link

ghost commented Apr 14, 2021

🎉This issue was addressed in #8392, which has now been successfully released as Windows Terminal Preview v1.8.1032.0.:tada:

Handy links:

@ghost
Copy link

ghost commented May 25, 2021

🎉This issue was addressed in #8392, which has now been successfully released as Windows Terminal v1.8.1444.0.:tada:

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants