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

Closed
opened 2026-01-30 23:16:36 +00:00 by claunia · 6 comments
Owner

Originally created by @flindeberg on GitHub (Aug 7, 2019).

Originally assigned to: @PankajBhojwani on GitHub.

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.

Originally created by @flindeberg on GitHub (Aug 7, 2019). Originally assigned to: @PankajBhojwani on GitHub. <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> 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 <!-- A clear and concise description of what you want to happen. --> (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): <img width="692" alt="terminal-split-pane" src="https://user-images.githubusercontent.com/11232267/62599791-728b4300-b8ed-11e9-8176-dfdf50184fc3.png"> An example from Linux (possible today, specifically Kali and Gnome terminal, focused terminal shown filled box while unfocused terminal shows nothing) ![root@TheHackerToday-_185](https://user-images.githubusercontent.com/11232267/62599986-fc3b1080-b8ed-11e9-8420-b7de035534b1.png) 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](https://user-images.githubusercontent.com/11232267/62600093-47edba00-b8ee-11e9-9228-e2eb34f0aa03.png) 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.
Author
Owner

@zadjii-msft commented on GitHub (Aug 8, 2019):

This is a pretty good idea.

@zadjii-msft commented on GitHub (Aug 8, 2019): This is a pretty good idea.
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 8, 2019):

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

@DHowett-MSFT commented on GitHub (Aug 8, 2019): Hey we just came to the same conclusion. Good idea, terminal backlog is great for it. :smile:
Author
Owner

@fishzle commented on GitHub (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.

@fishzle commented on GitHub (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.
Author
Owner

@flindeberg commented on GitHub (Aug 15, 2019):

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).

@flindeberg commented on GitHub (Aug 15, 2019): > 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).
Author
Owner

@ghost commented on GitHub (Apr 14, 2021):

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

Handy links:

@ghost commented on GitHub (Apr 14, 2021): :tada:This issue was addressed in #8392, which has now been successfully released as `Windows Terminal Preview v1.8.1032.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.8.1032.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (May 25, 2021):

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

Handy links:

@ghost commented on GitHub (May 25, 2021): :tada:This issue was addressed in #8392, which has now been successfully released as `Windows Terminal v1.8.1444.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.8.1444.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3238