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

Feature Request: Specify cursor behaviour on window focus / unfocus #2316

Closed
flindeberg opened this issue Aug 7, 2019 · 6 comments · Fixed by #8392
Closed

Feature Request: Specify cursor behaviour on window focus / unfocus #2316

flindeberg opened this issue Aug 7, 2019 · 6 comments · Fixed by #8392
Assignees
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. 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

@flindeberg
Copy link

Description of the new feature/enhancement

Currently I find it hard to find focus, and confusing to pasting text into unfocused terminals, since you cannot change cursor behaviour in unfocused terminals. For example by changing color or opacity (I do not know the feasability of this).

Proposed technical implementation details

(Speculating without looking at actual code for ease of implementation, and images curtesy of Google image search along the lines of "terminal [window] focus") Since I like box cursors, I will provide three examples with box cursors which can be extended to other types of cursors.

An example from Code (possible today, terminal in focus shows unfilled box as cursor, terminal out of focus does not):
terminal-split-pane

An example from Linux (possible today, specifically Kali and Gnome terminal, focused terminal shown filled box while unfocused terminal shows nothing)
root@TheHackerToday-_185

Another example from Linux (not possible today, specifically Ubuntu and Tilix terminal emulator, focused terminal shows filled box while unfocused terminal shows unfilled box)
Tilix-Interface

I do not propose that the result should be static, rather that the user can select what the cursor should look like in a focused window and an unfocused window. I.e.:

... profiles.json ...
"cursorShapeWindowFocus" : "filledBox",
"cursorShapeNoWindowFocus" : "emptyBox",
...

Of course taking height for #1203 so that the "filledBox" setting becomes more meaningful.

@flindeberg flindeberg added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Aug 7, 2019
@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 Aug 7, 2019
@zadjii-msft
Copy link
Member

This is a pretty good idea.

@zadjii-msft zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. labels Aug 8, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Aug 8, 2019
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Aug 8, 2019
@zadjii-msft zadjii-msft added the Help Wanted We encourage anyone to jump in on these. label Aug 8, 2019
@DHowett-MSFT
Copy link
Contributor

Hey we just came to the same conclusion. Good idea, terminal backlog is great for it. 😄

@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 Aug 8, 2019
@fishzle
Copy link

fishzle commented Aug 10, 2019

This is an option, but you could also highlight/frame/focus the pane with the active cursor. Or, the one that sometimes get's implemented is de-focus the inactive panes (eg increase transparency, reduce contrast in text, etc).

I'm not saying cursor-highlight is right or wrong, I'm just saying the range of possible solutions is > changing-shape-fill-colour of cursor.

Note that there may be relationship to mouse-behaviours like focus-follows-mouse / click-to-focus etc.

@flindeberg
Copy link
Author

I'm not saying cursor-highlight is right or wrong, I'm just saying the range of possible solutions is > changing-shape-fill-colour of cursor.

I completely agree, I just wrote this issue with a suggested solution since I got frustrated after playing around with Windows Terminal and mutliple tabs / windows and constantly getting the vim / emacs / nano / other nox-editor right-click-pastes-into-unfocused-window wrong (not to mention that you have to click twice, once to focus, and once to paste).

Ties into #2444 (single click should focus and paste) and #524 (marking text should put text in clipboard) as the mouse as the primary copy-and-paste tool between terminals (which the mouse should do well IMHO, but it should do neither more nor less).

@zadjii-msft zadjii-msft removed the Help Wanted We encourage anyone to jump in on these. label Feb 9, 2021
@ghost ghost added the In-PR This issue has a related PR label Feb 9, 2021
@ghost ghost added In-PR This issue has a related PR and removed In-PR This issue has a related PR labels Mar 26, 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 Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. 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.

6 participants