[Feature] Add option to control thickness of the bar cursor with cursorWidth #13259

Closed
opened 2026-01-31 03:37:58 +00:00 by claunia · 5 comments
Owner

Originally created by @nickjj on GitHub (Mar 31, 2021).

Description of the new feature/enhancement

If we set the cursorShape to bar we get a thin vertical line as a cursor.

It would be really nice if we could get a new cursorWidth variable to control the width of the bar cursor. It could be similar to the cursorHeight which controls the height of the vintage cursor.

With https://github.com/microsoft/terminal/issues/9610 on the way to add support for an inverted cursor color under the current character, terminal Vim users are going to be in a great spot to start using a combination of the block cursor in normal mode and a line / bar cursor for insert mode.

However the bar cursor is very thin. It's a bit difficult to see and very difficult to see if you happen to create presentations, talks or videos where folks are following along.

It would be very useful to be able to configure the width of the cursor to be a few more pixels wide and have that be the bar cursor for using the terminal regularly as well as when you configure Vim to switch between the bar and block cursor.

Currently in Vim you can add this to your Vim config file to switch between the bar and block cursor depending on if you're in insert or normal mode. You can use these settings to test the feature or just see the difference between both cursors.

" Set insert mode to the steady bar cursor.
let &t_SI = "\e[6 q"

" Set normal mode to the steady block cursor.
let &t_EI = "\e[2 q"

If you're wondering what those numeric values are are, here's how to adjust them:

Ps = 0  -> blinking block.
Ps = 1  -> blinking block (default).
Ps = 2  -> steady block.
Ps = 3  -> blinking underline.
Ps = 4  -> steady underline.
Ps = 5  -> blinking bar (xterm).
Ps = 6  -> steady bar (xterm).

Before / after this potential feature being implemented

Here's the current bar cursor inside of Vim using the Microsoft Terminal. When the cursor is next to taller characters it's a bit harder to see. Although IMO it's also a bit hard to see between most other characters too:

image

And here's what it could look like if it were thicker. This is currently a screenshot taken from VSCode since it lets you configure the width of the cursor:

image

Proposed technical implementation details (optional)

A new cursorWidth option that ranges from 1-100 to somewhat match what cursorHeight does. Although if you can think of a better configuration value by all means do it up.

Originally created by @nickjj on GitHub (Mar 31, 2021). # Description of the new feature/enhancement If we set the `cursorShape` to `bar` we get a thin vertical line as a cursor. It would be really nice if we could get a new `cursorWidth` variable to control the width of the `bar` cursor. It could be similar to the `cursorHeight` which controls the height of the `vintage` cursor. With https://github.com/microsoft/terminal/issues/9610 on the way to add support for an inverted cursor color under the current character, terminal Vim users are going to be in a great spot to start using a combination of the block cursor in normal mode and a line / bar cursor for insert mode. However the bar cursor is very thin. It's a bit difficult to see and very difficult to see if you happen to create presentations, talks or videos where folks are following along. It would be very useful to be able to configure the width of the cursor to be a few more pixels wide and have that be the bar cursor for using the terminal regularly as well as when you configure Vim to switch between the bar and block cursor. Currently in Vim you can add this to your Vim config file to switch between the bar and block cursor depending on if you're in insert or normal mode. You can use these settings to test the feature or just see the difference between both cursors. ```vim " Set insert mode to the steady bar cursor. let &t_SI = "\e[6 q" " Set normal mode to the steady block cursor. let &t_EI = "\e[2 q" ``` If you're wondering what those numeric values are are, here's how to adjust them: ``` Ps = 0 -> blinking block. Ps = 1 -> blinking block (default). Ps = 2 -> steady block. Ps = 3 -> blinking underline. Ps = 4 -> steady underline. Ps = 5 -> blinking bar (xterm). Ps = 6 -> steady bar (xterm). ``` # Before / after this potential feature being implemented Here's the current bar cursor inside of Vim using the Microsoft Terminal. When the cursor is next to taller characters it's a bit harder to see. Although IMO it's also a bit hard to see between most other characters too: ![image](https://user-images.githubusercontent.com/813219/113203802-7b572800-923a-11eb-8aff-49c890e43ba2.png) And here's what it could look like if it were thicker. This is currently a screenshot taken from VSCode since it lets you configure the width of the cursor: ![image](https://user-images.githubusercontent.com/813219/113204360-3aabde80-923b-11eb-8f02-10322303cdd8.png) # Proposed technical implementation details (optional) A new `cursorWidth` option that ranges from 1-100 to somewhat match what `cursorHeight` does. Although if you can think of a better configuration value by all means do it up.
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 03:37:59 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Mar 31, 2021):

Thanks for the suggestion! This is actually already being tracked by another issue on our repo - please refer to #3167 for more discussion.

/dup #3167

@zadjii-msft commented on GitHub (Mar 31, 2021): Thanks for the suggestion! This is actually already being tracked by another issue on our repo - please refer to #3167 for more discussion. /dup #3167
Author
Owner

@ghost commented on GitHub (Mar 31, 2021):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Mar 31, 2021): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Author
Owner

@nickjj commented on GitHub (Mar 31, 2021):

Thanks, I missed that when searching.

Is that feature going to be taken on now that #9610 is a thing?

Because #3167 has been open for 18 months without any activity.

@nickjj commented on GitHub (Mar 31, 2021): Thanks, I missed that when searching. Is that feature going to be taken on now that #9610 is a thing? Because #3167 has been open for 18 months without any activity.
Author
Owner

@zadjii-msft commented on GitHub (Mar 31, 2021):

Probably eventually, but it's not a super highly requested feature so it's WAY down the backlog. If you're feeling particularly passionate though, you're free to open a PR ☺️

@zadjii-msft commented on GitHub (Mar 31, 2021): Probably eventually, but it's not a super highly requested feature so it's _WAY_ down the backlog. If you're feeling particularly passionate though, you're free to open a PR ☺️
Author
Owner

@nickjj commented on GitHub (Mar 31, 2021):

The passion is there as a terminal Vim user who likes to create free video tutorials, but sadly my C++ background is non-existent so I can't realistically see myself opening a PR.

@nickjj commented on GitHub (Mar 31, 2021): The passion is there as a terminal Vim user who likes to create free video tutorials, but sadly my C++ background is non-existent so I can't realistically see myself opening a PR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13259