| Ticket UUID: | 55660624f7de49cca846ca3d66f94084c99d9229 | |||
| Title: | Block cursor in text widget may hide the character underneath | |||
| Type: | Bug | Version: | core-8-6-branch | |
| Submitter: | fvogel | Created on: | 2025-06-01 20:27:14 | |
| Subsystem: | 18. [text] | Assigned To: | nobody | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2026-05-05 12:20:30 | |
| Resolution: | Fixed | Closed By: | jan.nijtmans | |
| Closed on: | 2026-05-05 12:20:30 | |||
| Description: |
The -blockcursor widget option controls the drawing of the cursor. However, drawing the cursor as a solid blinking block is not exactly performed as in real or emulated terminals. The character at the cursor position is always drawn in it's foreground color, i.e. not in "reverse video", which can lead to unwanted visual effects and even hide the character entirely, when the cursor is in its on-state. This was first reported by Christian Werner as part of [5d0bc3cfec] (see Issue 3. in my comment there dated 2025-05-31 14:25:43, and the discussion that stemmed from this later). When this gets fixed, [1d39bb1448|this commit] mentioning the problem in the [text] man page should be backed out. | |||
| User Comments: |
jan.nijtmans added on 2026-05-05 12:20:30:
Now [f3c27ce5df1cab40|fixed] in the revised_text branch too, using Csaba's suggestion. Thanks! nemethi (claiming to be Csaba Nemethi) added on 2026-04-15 08:38:27:
Maybe, but somebody would have to implement that new option before we can judge which method needs less overhead. I know almost nothing about the implementation of the legacy and revised text widgets, hence I cannot tell how hard or easy it would be to port the code related to the jan.nijtmans added on 2026-04-15 08:17:35: Thanks, Scaba! This sounds like a good solution. I'm even wondering: Would introducing a -insertforeground option in trunk (would need a TIP) help to make the implementation simpler for trunk? nemethi (claiming to be Csaba Nemethi) added on 2026-04-12 17:23:06:
Jan, I have examined your question, with the following result: Porting this fix to the The The From the above it follows that for a revised text widget, the "reverse video" effect for the block cursor can be achieved by simply specifying -showinsertforeground 1 While this is quite simple, it can even become unnecessary by changing the default value of the Proposal: Apply the straightforward changes shown in the following
That is, change a single character in the file nemethi (claiming to be Csaba Nemethi) added on 2026-04-10 09:55:53: I think so. Right now I have no time, but I will examine it ASAP (within the next few days). jan.nijtmans added on 2026-04-10 08:42:59: Many thanks, Csaba! Would it be possible to bring over the same fix to the revised_text branch as well? nemethi (claiming to be Csaba Nemethi) added on 2026-04-01 16:24:57: Fixed in core-8-6-branch, core-9-0-branch, and trunk. See commits [ddeb13a3], [fc61e7f7], and [ef466dbd]. oehhar added on 2026-03-30 13:16:27: Ok, thanks. nemethi (claiming to be Csaba Nemethi) added on 2026-03-30 12:28:18: Harald, please let me do the merge myself when the CI is clean. The new version has to land in all three branches core-8-6-branch, core-9-0-branch, and trunk, and I have already prepared them for this action. For example, the trunk version should use bool for a few variables which must be of type int in the two other branches. oehhar added on 2026-03-30 11:55:50: Great work Christian and Csaba, we appreciate. I will merge if CI is clean. Thanks for all, Harald nemethi (claiming to be Csaba Nemethi) added on 2026-03-30 11:35:01: I have just committed a slightly improved version, which runs for me as expected (see commit [65bcb9be]. This version handles the "-insertunfocussed solid" setting in the same way as "-blockcursor 1". IMHO, the branch bug-55660624f7 is now ready to merge. oehhar added on 2026-03-27 11:41:18: The opinion "ugly" was by Francois. Perhaps, others have other opinions. Csaba, Jan? Thanks for all, Harald chw added on 2026-03-27 10:13:59: Harald, so we have an ugly solution for a nice problem, which makes the advertised feature finally at least usable, which it was not in the first place. A choice between pest and cholera, just saying. So let me quote Bryce from Max Headroom: "Oh, yes", said Bryce. "But you know it really isn’t my problem. My brief was to stop channel switching. I mean I only invent the bomb – I don't drop it. Ha ha!" oehhar added on 2026-03-27 08:34:48: Please allow me to ping on the Block Cursor patch block by Christian. When Francois left, this was forgotten. Are there any opinions on this? The "parent" patch about this [5d0bc3cfec] was merged by Francois (Thanks again). Thanks for all, Harald fvogel added on 2025-06-01 20:38:42: Christian has proposed a patch to fix this, see [875cbd9ff2]. This patch is creating, at display time, a temporary chunk with a style having a graphics context foreground color pulled from the text widget background color (picked from its border attribute) instead of from the foreground color of the text. As a result the character "under" the block cursor is drawn in the background color of the text widget instead of its foreground color, which reveals this character since the cursor is drawn with the foreground color of the widget. IMHO the proposed patch is quite ugly and should be refined before being considered for a merge. | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki