! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Cursor disappears when when moving cursor with arrow keys
Status:
RESOLVED: INVALID
Product:
Xfce4-terminal
Component:
General

Comments

Description Batou 2017-07-17 08:54:47 CEST
Hello,

After I updated to xfce4-terminal 0.8.6, I've noticed that the cursor now completely disappears as I move into existing text on screen. For example, if I type some command and use my arrow keys to move backward in text. I've been using xfce4-terminal for many years and never had any issues. 

I have my cursor set to: Block and "Cursor blinks" is disabled. As the cursor is moved over existing text, it does not show up. Colors are not inverted or anything.

Interestingly, if I right click on the terminal or unfocus the xfce4-terminal window by bringing some other window into focus, the outline of the block cursor does show up and you can see where it is.

I can see the cursor if I choose I-beam from the Preferences and then as I move the cursor around, it's shown as a block cursor and colors are inverted and you can see where it is. This is how it worked before.

Please let me know if you need more info.

OS: Arch Linux
Name            : xfce4-terminal
Version         : 0.8.6-1
Build Date      : Sun 16 Jul 2017 01:57:49 AM EDT
Install Date    : Sun 16 Jul 2017 04:32:08 AM EDT
Comment 1 Igor editbugs 2017-07-17 13:58:23 CEST
Hi, I cannot reproduce this on my Arch Linux system with 0.8.6.
Do other vte-based terminals (e.g. gnome-terminal) behave the same way?

One thing this could be related to is new "cursor foreground setting" that I added. Please check Preferences->Colors->Cursor color. Does unchecking the Cursor color box (i.e. using default colors) solve your issue?

> I can see the cursor if I choose I-beam from the Preferences and then as I move the cursor around, it's shown as a block cursor and colors are inverted and you can see where it is. This is how it worked before.
This is weird, too. Are you saying I-beam cursor has always been transforming to block cursor when moving it? I am not seeing that.
Comment 2 Egmont Koblinger 2017-07-17 14:32:10 CEST
> Interestingly, if I right click on the terminal or unfocus the xfce4-terminal window by bringing some other window into focus, the outline of the block cursor does show up and you can see where it is.

What happens if after this you give back the focus to this window? Does the block cursor show up properly, or disappear again?
Comment 3 Batou 2017-07-17 17:55:48 CEST
>Do other vte-based terminals (e.g. gnome-terminal) behave the same way?

I'm not sure about others but xterm behaves normally. I don't have any GNOME Shell stuff installed...

>One thing this could be related to is new "cursor foreground setting" that I added. Please check Preferences->Colors->Cursor color. Does unchecking the Cursor color box (i.e. using default colors) solve your issue?

After I checked the "Cursor color", I can see the cursor! I guess that solves the issue. But it is weird that by default, it would disappear like that. I've tried changing color schemes but that didn't fix it.

>This is weird, too. Are you saying I-beam cursor has always been transforming to block cursor when moving it? I am not seeing that.

Here's what I see on my setup and Gruvbox color scheme. After I pick I-Beam and move the cursor around. I-Beam is still visible but the character to the right of it is in red which is the "tab activity color" on this color scheme.

>What happens if after this you give back the focus to this window? Does the block cursor show up properly, or disappear again?

It just disappears again! It's visible when it's in background or when I right click on the terminal.
Comment 4 Igor editbugs 2017-07-17 17:59:36 CEST
(In reply to Batou from comment #3)
> >One thing this could be related to is new "cursor foreground setting" that I added. Please check Preferences->Colors->Cursor color. Does unchecking the Cursor color box (i.e. using default colors) solve your issue?
> 
> After I checked the "Cursor color", I can see the cursor! I guess that
> solves the issue. But it is weird that by default, it would disappear like
> that. I've tried changing color schemes but that didn't fix it.

Could you please paste your config (~/.config/xfce4/terminal/terminalrc) for both cases: when you see your issue and when you don't?
Comment 5 Batou 2017-07-17 18:14:59 CEST
Here's few screenshots illustrating what I mean... just so you we're sure we are on the same page:

https://i.imgur.com/7pL5VFX.png

Terminal in the foreground, I've moved the cursor left by using arrow keys, "cursor foreground setting" is unchecked. Cursor cannot be seen.

and now:

https://i.imgur.com/VhRAzzd.png

Window is in the background, cursor is visible.

I-Beam cursor selected. Cursor at the end of text:
https://i.imgur.com/z6jo5au.png

and now the cursor has been moved, becomes a block:
https://i.imgur.com/1n8d4UA.png

I've never used I-Beam outside vim (where it's my insert cursor) so don't know if this is what xfce4-terminal looked like before.

Finally, after I checked the "cursor foreground color" and selected the same color as my text, everything seems to be normal again:

https://i.imgur.com/VUHmnfJ.png

Anyway, I like being able to set cursor color but maybe turn it on by default so others don't end up confused like me? Not sure what the proper defaults are :)

Thank you guys so much! I'm happy again :)
Comment 6 Batou 2017-07-17 18:16:24 CEST
Igor,

I see issue with this:

-----

[Configuration]
FontName=Iosevka Term 10
MiscAlwaysShowTabs=FALSE
MiscBell=FALSE
MiscBordersDefault=TRUE
MiscCursorBlinks=FALSE
MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK
MiscDefaultGeometry=144x42
MiscInheritGeometry=FALSE
MiscMenubarDefault=FALSE
MiscMouseAutohide=TRUE
MiscToolbarDefault=FALSE
MiscConfirmClose=TRUE
MiscCycleTabs=TRUE
MiscTabCloseButtons=TRUE
MiscTabCloseMiddleClick=FALSE
MiscTabPosition=GTK_POS_TOP
MiscHighlightUrls=TRUE
MiscScrollAlternateScreen=TRUE
MiscBellUrgent=FALSE
MiscMiddleClickOpensUri=FALSE
MiscDefaultWorkingDir=
ScrollingLines=2000
ScrollingOnOutput=FALSE
ColorForeground=#ebebdbdbb2b2
ColorBackground=#282828
MiscMouseWheelZoom=TRUE
MiscCopyOnSelect=FALSE
MiscRewrapOnResize=TRUE
MiscUseShiftArrowsToScroll=FALSE
MiscSlimTabs=TRUE
ScrollingUnlimited=TRUE
BackgroundDarkness=1.000000
ScrollingBar=TERMINAL_SCROLLBAR_NONE
FontAllowBold=FALSE
ColorCursor=#ebebdbdbb2b2
ColorPalette=#665c54;#fb4934;#83a598;#d79921;#b16286;#458588;#b8bb26;#d65d0e;#a89984;#fb4934;#8ec07c;#fabd2f;#d3869b;#689d6a;#98971a;#fe8019;

-----------

and no issue when I enable that new cursor option:

-------

[Configuration]
FontName=Iosevka Term 10
MiscAlwaysShowTabs=FALSE
MiscBell=FALSE
MiscBordersDefault=TRUE
MiscCursorBlinks=FALSE
MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK
MiscDefaultGeometry=144x42
MiscInheritGeometry=FALSE
MiscMenubarDefault=FALSE
MiscMouseAutohide=TRUE
MiscToolbarDefault=FALSE
MiscConfirmClose=TRUE
MiscCycleTabs=TRUE
MiscTabCloseButtons=TRUE
MiscTabCloseMiddleClick=FALSE
MiscTabPosition=GTK_POS_TOP
MiscHighlightUrls=TRUE
MiscScrollAlternateScreen=TRUE
MiscBellUrgent=FALSE
MiscMiddleClickOpensUri=FALSE
MiscDefaultWorkingDir=
ScrollingLines=2000
ScrollingOnOutput=FALSE
ColorForeground=#ebebdbdbb2b2
ColorBackground=#282828
MiscMouseWheelZoom=TRUE
MiscCopyOnSelect=FALSE
MiscRewrapOnResize=TRUE
MiscUseShiftArrowsToScroll=FALSE
MiscSlimTabs=TRUE
ScrollingUnlimited=TRUE
BackgroundDarkness=1.000000
ScrollingBar=TERMINAL_SCROLLBAR_NONE
FontAllowBold=FALSE
ColorCursor=#ebebdbdbb2b2
ColorPalette=#665c54;#fb4934;#83a598;#d79921;#b16286;#458588;#b8bb26;#d65d0e;#a89984;#fb4934;#8ec07c;#fabd2f;#d3869b;#689d6a;#98971a;#fe8019;
ColorCursorUseDefault=FALSE
Comment 7 Igor editbugs 2017-07-17 18:56:42 CEST
Batou, thanks for the update and configs, I will study them.

Another question: Will the issue persist if you use simpler $PS1, e.g. PS1='\$ ' ?
Comment 8 Batou 2017-07-17 19:15:54 CEST
Hi Igor!

Here's some tests... I've disabled the new 'cursor foreground color' option.

Simple PS1, window in the foreground: 

https://i.imgur.com/EnYRUzt.png

No difference.

Same window in the background:

https://i.imgur.com/4vpWVMS.png

Cursor can now be seen.
Comment 9 Igor editbugs 2017-07-17 19:25:32 CEST
Batou, thanks again for the update!

I've checked both of your configs on my Ubuntu 16.04 VM here, and I can see the cursor in both cases. The only thing is that the text under cursor isn't visible with the 2nd config, but the cursor itself is fine.
I will check your configs on my hone Arch machine as well.

Meanwhile, could you please check what versions of gtk3 and vte3 you have installed in your system?
Comment 10 Batou 2017-07-17 19:34:51 CEST
Igor, thank you so much for looking into this. It could be a combination of GTK3 and something else. I do not know.

$ pacman -Q | grep gtk3
gtk3 3.22.16-1
gtk3-print-backends 3.22.16-1
libappindicator-gtk3 12.10.0-12
libdbusmenu-gtk3 16.04.0-2
libindicator-gtk3 12.10.1-7
wxgtk3 3.0.3.1-7

$ pacman -Qi gtk3
Name            : gtk3
Version         : 3.22.16-1
Description     : GObject-based multi-platform GUI toolkit
Architecture    : x86_64
...
Build Date      : Tue 20 Jun 2017 05:22:35 PM EDT
Install Date    : Tue 20 Jun 2017 07:16:37 PM EDT


$  pacman -Q | grep vte3
vte3 0.48.3-1


$ pacman -Qi vte3
Name            : vte3
Version         : 0.48.3-1
Description     : Virtual Terminal Emulator widget for use with GTK3
Architecture    : x86_64
URL             : https://wiki.gnome.org/Apps/Terminal/VTE
Licenses        : LGPL
Groups          : None
Provides        : None
Depends On      : gtk3  pcre2  gnutls  vte-common
Optional Deps   : None
Required By     : xfce4-terminal
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 1381.00 KiB
Build Date      : Wed 10 May 2017 03:15:31 AM EDT
Install Date    : Wed 10 May 2017 10:18:17 AM EDT
Comment 11 Egmont Koblinger 2017-07-17 20:24:31 CEST
I cannot reproduce either on Ubuntu Zesty.

Any chance that Arch patches their vte3 in a way that breaks this?
Comment 12 Egmont Koblinger 2017-07-17 20:26:19 CEST
Batou, could you please confirm what's going on in your comment 8's second screenshot? You say the window's in the background, yet the cursor is a solid rectangle rather than outlined. It's suspicious.
Comment 13 Igor editbugs 2017-07-17 20:27:56 CEST
(In reply to Egmont Koblinger from comment #11)
> I cannot reproduce either on Ubuntu Zesty.
> 
> Any chance that Arch patches their vte3 in a way that breaks this?
Hi Egmont, according to https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/vte3, there are no patches Arch maintainers add.
Comment 14 Batou 2017-07-17 21:13:30 CEST
Hi Egmont,

Correct. In the second screenshot, terminal is in the background (you can tell by the window widgets at the top... they're grayed out).

I get the outline box only when the cursor is at the end of the line and not under a character. In this case, cursor is always visible.

For example: https://i.imgur.com/cBOZ0Js.png

If I move the cursor so it's under a character, it disappears when in foreground and when it's in the background, it's the inverse of the color of the character that it's under.

Example: https://i.imgur.com/XCFMN9N.png


In both instances, Color Cursor option is unchecked.
Comment 15 Egmont Koblinger 2017-07-17 21:23:36 CEST
That's not okay, and could be the key to figure out what's going on.

The block cursor always switches to outline when the window loses focus.

What I suspect happens is pretty much the same as what was discussed at https://github.com/tomasr/molokai/pull/44. I suspect that whatever shell or theme you're using itself manually swaps the fg/bg colors under the cursor. This, as well as VTE by default swapping too, cancel out each other.

What shell, theme and other setting do you use?

If further investigation is needed, could you please reproduce the problem under "script", and after quiitting that shell, attached the resulting "typescript" file? That would cleanly prove or disprove my theory.
Comment 16 Batou 2017-07-17 21:31:12 CEST
Hi Egmont,

Interesting. 

I've used this exact same setup for 4+ years and never had an issue with disappearing cursors. Maybe the issue was always there but due to some quirk, it was never exposed.

Color scheme is Gruvbox. Not sure where a repo for it is but the  gruvbox-dark.theme file is this:

----------
[Scheme]
Name=gruvbox-dark
ColorForeground=#ebdbb2
ColorBackground=#282828
# ColorCursor=#ebdbb2
ColorCursor=#9C8F70
ColorPalette=#665c54;#fb4934;#83a598;#d79921;#b16286;#458588;#b8bb26;#d65d0e;#a89984;#fb4934;#8ec07c;#fabd2f;#d3869b;#689d6a;#98971a;#fe8019;

----------

Shell is zsh (straight out of the Arch repo) with prezto : https://github.com/sorin-ionescu/prezto and it's the default PS1.


>could you please reproduce the problem under "script", and after quiitting that shell, attached the resulting "typescript" file? That would cleanly prove or disprove my theory
Not sure what you mean by this...
Comment 17 Egmont Koblinger 2017-07-17 21:33:48 CEST
Start the command "script". You should get another zsh just as you do normally. Reproduce the problem there (type something and move the arrow to the left). Then exit this shell. You'll see a file called "typescript" which is a log of what was printed by zsh.
Comment 18 Batou 2017-07-17 21:42:29 CEST
Egmont, got it! Here's the typescript:

http://ge.tt/8X5kGpl2  (19kB)

Cursor did indeed disappear during this test.
Comment 19 Egmont Koblinger 2017-07-17 21:53:22 CEST
I was right with my guess! :)

I ran slowcat (a debug binary inside vte's source) to slowly cat this file. I have I-beam cursor. Yet, I saw full inverse blocks (kinda block cursor) as you moved back in the command line.

It's all in line 2 of the typescript file; line 3 & 4 are printed by vim.

Around column 360 the "hello\ there" text is visible, soon followed by ".txt". The following hundred or so characters are full of backspaces (as you walk to the left with the cursor), single t or x letters and such, as well as... tadaaa... plenty of occurrences of the escape sequences ^[[7m (enable inverse mode) and ^[[27m (disable inverse mode). So yup, your zsh explicitly inverts the character under your cursor.

There's no VTE bug here. You should consult with zsh and/or the zsh theme (don't know which, I'm not a zsh user) for how to disable this (mis?)feature, and even what's the rationale behind this idea (I'd be happy to hear the answer to the latter).
Comment 20 Batou 2017-07-17 21:56:02 CEST
Thank you so much Egmont for looking into this!
Comment 21 Egmont Koblinger 2017-07-17 21:57:12 CEST
You're welcome, I was happy to help! :)
Comment 22 Igor editbugs 2017-07-17 22:02:51 CEST
Thanks a lot, Egmont!
I'm closing this one as INVALID since this isn't a terminal or even vte bug.

Bug #13719

Reported by:
Batou
Reported on: 2017-07-17
Last modified on: 2017-07-17

People

CC List:
1 user

Version

Attachments

Additional information