microsoft / microsoft/terminal

cursorWidth for vertical bar

Open
#3,167 7 comments 26 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Settings Help Wanted Issue-Task Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

Description of the new feature/enhancement

My preferred cursor shape is "bar", and thus I'm happy to see that this is WT's default.

(My reason is that this is what every modern application does, carrying the semantics that the cursor is between two characters rather than over one. I found that in the terminal-based apps I'm using it becomes more obvious to know e.g. the boundaries of a piece of text as I'm selecting it, without potential off-by-ones – especially when the application uses inverse colors for the selected text, and so does the terminal for its solid rectangle cursor.)

There's one big disadvantage though: It's hard to locate if your eyes don't know where to look for it.

So I propose a config option to make the bar wider, analogously to the already existing "cursorHeight" for "vintage".

(On a side note, I'm wondering why "cursorHeight" doesn't apply to "underscore" too; in fact, why these are two different cursor shapes rather than one with a different height...)

Proposed technical implementation details

A new option "cursorWidth" for the "bar" shape, or perhaps "cursorHeight" and "cursorWidth" merged into a common option.

I don't have a firm opinion whether the width should grow only to the right, or evenly to both sides. I'd probably only increase it from 1px to 2px for myself, so it doesn't really matter to me. I'd leave it to you to make a choice. In VTE it only grows to the right, mostly because we only have a 1px padding by default as opposed to your 8px, and we wouldn't want to chop it off when it's at the beginning of a line.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing cursorHeight handling for the vintage shape and the rendering path for the bar cursor. Define the cursorWidth configuration behavior, including its growth direction, then add coverage showing that the bar cursor width changes as configured.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.