kuthulux / gnome-connection-manager

repository for gnome-connection-manager from kuthulu.com/gcm
Other
66 stars 27 forks source link

The "top" command output in Xubuntu 20.04 is formatted wrong and not usefull #51

Closed EvilBob01 closed 3 years ago

EvilBob01 commented 3 years ago

When I load up a terminal and type "top" the output has a line break between every process, and instead of refreshing the display it just adds to the bottom and scrolls making it very hard to read.

Looks like this.

45 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/6

46 root -51 0 0 0 0 S 0.0 0.0 0:00.00 idle_inject/6

47 root rt 0 0 0 0 S 0.0 0.0 0:02.97 migration/6

48 root 20 0 0 0 0 S 0.0 0.0 0:03.47 ksoftirqd/6

But infinitely scrolling, as top updates.

Any suggestions?

kuthulux commented 3 years ago

maybe the term type is incorrectly recognized in xubuntu, what is the output of echo $TERM in regular termnal and inside gcm?

if they differ, you can try setting the global terminal type in settings - TERM, with the output from above

EvilBob01 commented 3 years ago

Thanks for the reply,

echo $TERM in regular terminal returns xterm-256color echo $TERM in GCM returns xterm-256color

FWIW, xfce4-terminal 0.8.9.1 is the "regular terminal"

Any other suggestions? I've mostly switched to using htop instead of top which works as expected in GCM.

kuthulux commented 3 years ago

i don't known,, i'm clueless now, the terminal should behave the same as the "regular" terminal.

i will have to install xubuntu to debug the issue

kuthulux commented 3 years ago

Hi

I installed xubuntu and the issue with top happens most of the time, specially when the scrollback buffer is bigger than the current screen. The problem doesn't happen in ubuntu (tried gnome and unity) and looks like the culprit is the Gtk.ScrolledWindow element in xfce4. That element is the one that draws the scroll bar and allows scrolling the contents of the terminal.

Looks like the way to fix it is to replace the Gtk.ScrolledWindow with a Gtk.Box and Gtk.Scrollbar, just like gnome-terminal and xfce4-terminal are doing rigth now.

please run the attached test case, it just creates a window, adds the terminal and scrollbar and executes bash. You can run top (or any other command) to see if the problem still persists or is fixed.

xubuntu-terminal-test.py.gz

EvilBob01 commented 3 years ago

That was fast! Good find.

I do typically set my scrollback to something outrageous. I think it's at 200,000 now.

I ran your python3 code "xubuntu-terminal-test.py" and it did create a window, added the scrollbar, and bash. When I run top it looks normal and behaves as expected! I tested a few applications top, iostat, iotop, and cat some big files. Everything looked good. I think you found it.

Thank you for going so far as to install xubuntu and test!

kuthulux commented 3 years ago

Hi @EvilBob01, I just uploaded the fix to branch "scrollbars-fix", please let me if it works correctly.

https://github.com/kuthulux/gnome-connection-manager/tree/scrollbars-fix

EvilBob01 commented 3 years ago

That looks like it fixed the issue I was having. Top is working as I expect it to now. Thanks again!