rabite0 / hunter

The fastest file manager in the galaxy!
Do What The F*ck You Want To Public License
1.31k stars 64 forks source link

Mouse events causes weird behavior #32

Closed Mart-Bogdan closed 5 years ago

Mart-Bogdan commented 5 years ago

When I move the mouse over the terminal window and touch scroll, or click mouse buttons, program start behaving strangely. image 1) 3 weird blue vertical bars are rendered between main panels. On each event, bar grows! 2) On left bar some random symbols appears, U,D,), 3) Above the right bar, several \ are rendered

Also, annoying event shows up on the bottom, that says me to not use the mouse, but this I could ignore.

I'd suggest just disable terminal mouse events, so users could use mouse for simply selecting the text, to be copied elsewhere.

rabite0 commented 5 years ago

I disabled mouse support for now since it's not used anyway.

Does that fix the glitched drawing?

That actually looks like it's printing an error message to the screen, which is then drawn over. Since I've never seen it print error messages due to unused mouse input I'm not sure if that's enough to fix the issue. If it persists, could you try starting hunter with "hunter 2> debug.txt" and paste the contents?

Mart-Bogdan commented 5 years ago

Hello, debug.txt is empty, 0 bites

winnie@winnie-Latitude-E6420:~$ hunter 2>debug.txt
winnie@winnie-Latitude-E6420:~$ less debug.txt 
winnie@winnie-Latitude-E6420:~$ less debug.txt 
winnie@winnie-Latitude-E6420:~$ cat debug.txt 
winnie@winnie-Latitude-E6420:~$ 

and furthermore, when I use less to view debug.txt (less debug.txt) i've got blue screen background: image If I resize terminal without less, and open less -- again blue screen. If I resize a virtual terminal with less opened, it resets the screen to the black background. image I've exited hunter with q key. Actually, this happens no matter if I redirected stderr. Seems hunter messes with terminal, not restoring it after exit.

rabite0 commented 5 years ago

Does it still draw crap when it receives mouse events or is this a different problem? What terminal is that? gnome-terminal? I'll test that one. I hope I get the same problem :).

Could you maybe try with xterm or some other terminal to see if it happens there, too? There have been mixed reports with this in the past.

I just re-enabled a call to "reset" when hunter quits. This is ugly, but it should fix the resetting in the mean-time.

Mart-Bogdan commented 5 years ago

Thanks @rabite0, tryed 1.1.2 and mouse issue go away.

Less issue still persist. I'm using Konsole from KDE 5 (Konsole 17.12.3)

Tryed in xterm, there is small issue with coloring, but not whole screen.

In GNOME Terminal all seems clear.

Strange. 0_O

Mart-Bogdan commented 5 years ago

on xterm only status line of less is blue image on Konsole whole screen image Weird, I thought all terminals are identical in terms of VT specification :-(

Mart-Bogdan commented 5 years ago

And I confirm that original bug (after checking out the previous version of Hunter) is reproducing only in Konsole, perhaps bug should be filed there?

Mart-Bogdan commented 5 years ago

UPD.
Konsole + tmux = no bug (both) Konsole + GNU Screen = slight color glitch after exit, and screen not gets сleared/restored, but no errors after that. Seems satisfyingly. (that's common behavior with screen in other programs) image

rabite0 commented 5 years ago

I completely revamped terminal resetting in the newest version. That should hopefully mostly fix these issues.

And yes, for some reason squeezing tmux in between often fixes many drawing glitches like this. It probably filters/rewrites escape codes on the fly. The most extreme example is Emacs's ansi-term. Without tmux hunter is totally glitched, but with tmux it's drawing perfectly fine, just unusably slow. urxvt also has some slight issues without tmux, but nothing major. Oh well, I'll get to that eventually.

Anyway, thank you for taking your time to all this testing. The information has been very valuable.

And I confirm that original bug (after checking out the previous version of Hunter) is reproducing only in Konsole, perhaps bug should be filed there?

Perhaps. I almost did a report, but when they wanted to know about the versions of various software and libraries I decided against it, since I don't know the specifics.

Weird, I thought all terminals are identical in terms of VT specification :-(

They do for the most part, but they all have different quirks/bugs and add different extensions on top of that.