Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse events on Windows Terminal 1.9 cause bottom to show errors and ignore events #562

Closed
ClementTsang opened this issue Jul 26, 2021 · 4 comments · Fixed by #878
Closed
Assignees
Labels
bug Something isn't working the way that is expected. upstream For issues that depend on an upstream fix/change.

Comments

@ClementTsang
Copy link
Owner

ClementTsang commented Jul 26, 2021

Before you report, please take a look at Troubleshooting to see if there's already an answer to your problem. Also check out existing issues and known problems to see if your problem is already reported/known.

Also, please fill in all fields if possible - if the issue is too hard to reproduce or vague, it may not be fixed!

Describe the bug

Give a high level description of the bug.

bottom spits out an error (see below for screenshot) on Windows Terminal when trying to use the mouse, then continues drawing while ignoring events.

What operating system/architecture are you using?

Please mention what operating system, version, and architecture you're experiencing the problem on (ex: macOS 10.13, x86_64). Please also ensure that your system is on the list of supported systems - bug reports on unsupported systems are likely to be closed.

Windows 10 21H1 19043.1110

What terminal are you using bottom on?

Please mention what terminal/terminal emulator you are using bottom on (ex: Konsole, Kitty).

Windows Terminal v1.9.1942.0

What version are you on?

Please ensure that the bug still exists on the latest stable release or newer (i.e. nightly). If so, mention
what version you are using here.

v.0.6.3

How did you install bottom?

Please mention how you installed bottom. If you manually compiled it, please also mention your Rust version.

Through choco

How can we reproduce this?

Provide detailed steps on how to reproduce your problem, to the best of your ability. Be as detailed as possible, and include config files or flags if relevant.
If maintainers cannot reproduce the bug, it will be very hard to fix it.

  1. Open Windows Terminal (v1.9)
  2. Open btm
  3. Try to use mouse controls and click around

What is the actual behaviour?

What is the actual result of the given steps? Be detailed. Please include screenshots if the issue is a visual one.

bottom spits out an error as shown in the screenshot when using mouse clicks, then continues drawing, and ignores events.

image

What is the expected behaviour?

What do you believe the expected behaviour should be given these steps?

bottom should not show an error like this - if anything, it should have just crashed.

@ClementTsang ClementTsang added the bug Something isn't working the way that is expected. label Jul 26, 2021
@ClementTsang
Copy link
Owner Author

Tried updating to 0.20 of crossterm - this issue is not fixed there either.

Barring adding a panic handler, I'll probably just file this upstream.

@ClementTsang
Copy link
Owner Author

Backtrace:

thread '<unnamed>' panicked at 'Event flag 3 does not exist.', C:\Users\Clement\.cargo\registry\src\github.com-1ecc6299db9ec823\crossterm_winapi-0.6.2\src\structs\input.rs:200:18
   0: backtrace::backtrace::trace_unsynchronized<closure-0>
             at C:\Users\Clement\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.59\src\backtrace\mod.rs:66   1: backtrace::backtrace::trace<closure-0>
             at C:\Users\Clement\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.59\src\backtrace\mod.rs:53   2: backtrace::capture::Backtrace::create
             at C:\Users\Clement\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.59\src\capture.rs:176
   3: backtrace::capture::Backtrace::new
             at C:\Users\Clement\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.59\src\capture.rs:140
   4: bottom::panic_hook
             at src\lib.rs:285
   5: btm::main::{{closure}}
             at src\bin\main.rs:121

@ClementTsang
Copy link
Owner Author

Long story short rn the state of the problem is that there's an unhandled event flag in crossterm which panics and kills the event handler thread.

I can bandaid this by slapping on a panic handler and trying to recover (I think?), but I'll wait a bit to see if there's a fix to the underlying issue.

@ClementTsang ClementTsang added the upstream For issues that depend on an upstream fix/change. label Oct 11, 2021
@ClementTsang ClementTsang self-assigned this Oct 11, 2021
@ClementTsang
Copy link
Owner Author

ClementTsang commented Nov 2, 2021

Note: with crossterm-rs/crossterm-winapi#20 being merged and 0.9 being available, I think(?) this can be unblocked and worked on.

Should be resolved by updating crossterm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working the way that is expected. upstream For issues that depend on an upstream fix/change.
Projects
No open projects
Status: Blocked
1 participant