Block cursor hides character underneath

2013-08-10
2013-08-11
  • Keith Packard

    Keith Packard - 2013-08-10

    Setting the cursor color causes the character under the cursor to be drawn with the normal foreground color. When the cursor color is the same as the foreground color, you end up unable to see the character under the cursor. VTE has a special case that draws the character under the cursor with the background color when the cursor color is set to NULL.

    Here's a patch which makes roxterm set the cursor color to NULL when it matches the foreground text color:

    From 9a9d9bf2a9bf64767dc7d542a580b6ac190a7469 Mon Sep 17 00:00:00 2001
    From: Keith Packard keithp@keithp.com
    Date: Sat, 10 Aug 2013 21:31:00 +0200
    Subject: [PATCH] When cursor colour matches fg colour, set cursor to NULL

    VTE has magic semantics for a NULL cursor colour, causing it to flip
    the text colour for characters under the cursor so you can read them
    that way.

    Signed-off-by: Keith Packard keithp@keithp.com

    src/roxterm.c | 8 ++++++--
    1 file changed, 6 insertions(+), 2 deletions(-)

    diff --git a/src/roxterm.c b/src/roxterm.c
    index 29eee80..60481d7 100644
    --- a/src/roxterm.c
    +++ b/src/roxterm.c
    @@ -1245,8 +1245,12 @@ static void roxterm_update_background(ROXTermData * roxterm, VteTerminal * vte)
    static void
    roxterm_update_cursor_colour(ROXTermData * roxterm, VteTerminal * vte)
    {
    - COLOUR_SET_VTE(_cursor)(vte,
    - colour_scheme_get_cursor_colour(roxterm->colour_scheme, TRUE));
    + COLOUR_T cursor_colour = colour_scheme_get_cursor_colour(roxterm->colour_scheme, TRUE);
    + COLOUR_T
    fg_colour = colour_scheme_get_foreground_colour(roxterm->colour_scheme, TRUE);
    +
    + if (cursor_colour && fg_colour && COLOUR_EQUAL(cursor_colour, fg_colour))
    + cursor_colour = NULL;
    + COLOUR_SET_VTE(_cursor)(vte, cursor_colour);
    }

    static void

    1.8.3.2

     
  • Tony Houghton

    Tony Houghton - 2013-08-11

    Thanks for the patch, but I don't think it's really necessary, because you can already make it NULL by unchecking the option. What I would really like is some action on https://bugzilla.gnome.org/show_bug.cgi?id=695011.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks