blinksh / blinksh/blink

In reverse video, cursor can disappear

Open
#144 11 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
Swift
Stars
6.9k
Forks
746
PR merge metrics
No merged PRs in 30d

Description

Granted this probably isn't exactly a _common_ occurrence, but while I have my terminals set to Solarized (Dark), I set my editor to Solarized Light to easily distinguish it and because it's a bit easier on my eyes for longer coding sessions.

Unfortunately, because the Blink cursor color is the same as the foreground text, that means it totally disappears. Observe, first with the cursor on line 2, column 1 of the file (from a terminal perspective, line 3 col 0, the opening brace in `{-# LANGUAGE...`)—it's very distinctive here because Emacs has highlighted it (along with the matching closing brace, which is _not_ where the cursor is) for application-specific reasons:
![file_000](https://cloud.githubusercontent.com/assets/97895/19015810/b04a2078-87d9-11e6-9529-89e14638e49c.png)

Now, I move down one line, to terminal line 4 col 0, at the beginning of `module CC where`:
![file_001](https://cloud.githubusercontent.com/assets/97895/19015816/d8290140-87d9-11e6-9f45-b4128a4149f5.png)

and, moving the cursor right by characters:
![file_002](https://cloud.githubusercontent.com/assets/97895/19015823/ed0448f4-87d9-11e6-97fe-7a631ac20c42.png)
![file_003](https://cloud.githubusercontent.com/assets/97895/19015824/f17e6eaa-87d9-11e6-98ee-d9e8ad566d08.png)

You can _just_ make out the location of the cursor because of the desaturation of the character underneath it, but it's nearly impossible to see on an iPad Pro (especially in night shift color rendering) and _is_ totally invisible when the cursor is not over a text character.

Based on what other terminal emulators do, I'd suggest either a "smart cursor" coloring that adapts to what's behind it (many shift to an outline when the cursor is within a solid multiline area of saturated color, or do a colorwheel calculation to dynamically find an appropriate color that's equidistant from foreground and background), or at least a change such that the cursor color cannot be _exactly_ the value of any of the defined theme colors, since it's always possible that you'll be in a solid multiline block of that color.

If you want something that's static in the theme but doesn't add an additional storage slot to the theme, perhaps a simple color shift algorithm to start with the foreground color and if it's light, darken by 5%, if dark, lighten by 5%, while avoiding other colors defined in the theme. But I'm just spitballing here; I just wanted to make you aware of the issue, as it's a usability showstopper for me—I know most folks don't use lots of colors in TTY mode, but I do. Thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named in the issue. Reproduce the disappearing cursor with Solarized Dark terminals and a Solarized Light editor, then inspect the terminal cursor and theme-color rendering paths; done means the cursor remains visibly distinguishable over text and empty background areas.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
design, mobile-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.