thestinger / termite

Termite is obsoleted by Alacritty. Termite was a keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support.
https://github.com/alacritty/alacritty
2.73k stars 240 forks source link

artifacts with htop #624

Closed ryanmjacobs closed 3 years ago

ryanmjacobs commented 6 years ago

Hi,

When I run htop inside termite it functions and renders correctly. However, when I switch to another desktop on my tiling window manager and come back later, the CPU bars have left artifacts. These artifacts remain for the rest of the program's lifetime and do not disappear.

artifacts exmaple (In this photo, my actual CPU is around 5-10% on each core.)

ryan@delta ~ $ uname -a
Linux delta 4.17.10-1-ARCH #1 SMP PREEMPT Wed Jul 25 11:23:00 UTC 2018 x86_64 GNU/Linux

ryan@delta ~ $ termite --version
termite v13

ryan@delta ~ $ pacman -Qs termite-terminfo
local/termite-terminfo 13-3 [installed]
    Terminfo for Termite, a simple VTE-based terminal

Any pointers would be well appreciated, I've tried source /etc/profile.d/vte.sh to no avail.

egmontkob commented 6 years ago

Hi,

(I'm a VTE developer but not a Termite developer.)

We're not aware of any similar bug in vte. At this point it could easily be an htop issue, or a yet undiscovered vte issue, or perhaps even something else (window manager, video card etc.). Pretty unlikely to be a bug in Termite itself.

What's your vte-ng version?

If you highlight (select) the buggy area with Shift+mouse, do the artifacts disappear, or do those bars remain there and get highlighted with reverse colors?

Do the artifacts disappear as soon as you quit htop?

While you are switched away, is it okay for htop to temporarily display those bars at all? I mean, do you think your CPU usage really goes up temporarily to 70-80%-ish and then drop back, do you perform CPU-intensive tasks on that desktop? (Or maybe the desktop switch itself is a CPU-sensitive operation for a short time.)

Approximately how reproducible is this bug? How long do you have to stay switched away?

Is the issue reproducible with non-VTE based terminal emulators (e.g. xterm, rxvt, st, konsole...)?

Thanks!

egmontkob commented 6 years ago

One more idea: Could you do an export TERM=xterm or export TERM=xterm-256color before starting htop? Is the bug still reproducible there? (Maybe termite's terminfo entry is the culprit, who knows...)

ryanmjacobs commented 6 years ago

Thank for the quick response, @egmontkob!

All right, well this is strange. After running a complete update on my machine (pacman -Syu) and rebooting this morning, the issue seems to have resolved itself completly.

What's your vte-ng version?

extra/vte-common 0.52.2-1 [installed]
community/libvterm 0.1.git1.c4317a6-3 [installed]
community/termite 13-3 [installed]
community/termite-terminfo 13-3 [installed]

If you highlight (select) the buggy area with Shift+mouse, do the artifacts disappear, or do those bars remain there and get highlighted with reverse colors?

I can't reproduce the bug right now, so I can't test this.

Do the artifacts disappear as soon as you quit htop?

Yes, but htop clears the screen on exit anyways.

While you are switched away, is it okay for htop to temporarily display those bars at all? I mean, do you think your CPU usage really goes up temporarily to 70-80%-ish and then drop back, do you perform CPU-intensive tasks on that desktop? (Or maybe the desktop switch itself is a CPU-sensitive operation for a short time.)

When I'm doing simple web browsing and editing, my CPU usage is really low (< 10% per core). I artificially spiked my CPU for about 10 seconds using timeout 10 stress -c 8 to reproduce the bug consistently. However, the issue is gone now....

Approximately how reproducible is this bug? How long do you have to stay switched away?

Yesterday, when the bug was present, it was very consistent. I only had to switch away for half a second for the artifacts to develop.

Is the issue reproducible with non-VTE based terminal emulators (e.g. xterm, rxvt, st, konsole...)?

I used xterm as my main terminal emulator for four years before switching to termite. I never had this problem before.


One more idea: Could you do an export TERM=xterm or export TERM=xterm-256color before starting htop? Is the bug still reproducible there? (Maybe termite's terminfo entry is the culprit, who knows...)

On my system $TERM is xterm-256color, which I keep set in my .bashrc and never change.


Anyways, I'm not sure how this bug resolved itself, but if it happens again in a reproducible way, I'll post more information.

egmontkob commented 6 years ago

After running a complete update on my machine [...] the issue seems to have resolved itself completly

Could have been something with htop or ncurses. At least, vte didn't receive any change that I believe could be relevant (assuming you didn't upgrade from a much older version).

If you highlight (select) the buggy area with Shift+mouse, do the artifacts disappear, or do those bars remain there and get highlighted with reverse colors?

Just so that I don't forget what I have in my mind whenever we can get back to it :)

If highlighting with the mouse repairs the problem then we're in bigger trouble, that'll be harder to track down. Could be a glitch in VTE, a problem with the compositor or video driver...

If highlighting doesn't repair it then VTE indeed believes those bars should be there. It's easier to debug. In this case the bug is either in htop (or underlying ncurses), or in VTE. To proceed, I'd recommend to run htop within script(1). Analyzing its output (or just replaying in an xterm of the same size, measured in characters) will tell us which component of these two is the culprit.

jelly commented 5 years ago

Please retest with the latest termite / vte-ng release

thestinger commented 3 years ago

Termite is obsolete. Please use Alacritty instead. See https://github.com/thestinger/termite#termite-is-obsoleted-by-alacritty for more details.