Fix cursor showing and hiding by ianthomas23 · Pull Request #141 · QuantStack/git2cpp · GitHub
Skip to content

Fix cursor showing and hiding#141

Merged
JohanMabille merged 2 commits into
QuantStack:mainfrom
ianthomas23:cursor-handling
Apr 17, 2026
Merged

Fix cursor showing and hiding#141
JohanMabille merged 2 commits into
QuantStack:mainfrom
ianthomas23:cursor-handling

Conversation

@ianthomas23

Copy link
Copy Markdown
Member

The cursor showing and hiding logic that I previously implemented via the cursor_hider scope object was buggy in that it could end up leaving the cursor hidden at the end of a git2cpp command. This would happen, for example, using a prompt_input which ensures that the cursor is enabled when the prompt is shown and then hides it at the end. The solution, in the presence of potentially nested cursor_hider objects, is to keep a static count of the number of active scope objects and ensure the cursor is shown when this goes down to zero.

It does introduce a static variable which isn't ideal but it is only a single unsigned int.

This is very hard to test, so I am not doing so in CI but I have tested it manually in both macos and wasm builds.

@ianthomas23 ianthomas23 added the bug Something isn't working label Apr 17, 2026
@ianthomas23 ianthomas23 marked this pull request as ready for review April 17, 2026 14:30
@codecov

codecov Bot commented Apr 17, 2026

Copy link
Copy Markdown

@JohanMabille JohanMabille merged commit d4e011b into QuantStack:main Apr 17, 2026
7 of 10 checks passed
@ianthomas23

Copy link
Copy Markdown
Member Author

@ianthomas23 ianthomas23 deleted the cursor-handling branch April 17, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants