-
Notifications
You must be signed in to change notification settings - Fork 288
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
read_sync
fails under LLDB debugging in Linux
#253
Comments
I would hypothesize that this happens because crossterm tries to obtain TTY handle by directly opening |
Thanks for reporting. Input layer is going through a couple of rewrites, the first is here: https://github.com/crossterm-rs/crossterm-input/pulls, we will have to see if the issue is resolved with this PR. Otherwise, it will be fixed in a other one. |
@TimonPost Let me know when that refactor lands and I'll check the status of this issue |
@joshhansen I tested your code with the PR (branch zrzka/unix-async-events). I can confirm that:
All tests were made with Test codeI just replaced
use std::io::{stdout, Write};
use crossterm_input::{input, InputEvent, KeyEvent, RawScreen};
fn main() {
let _raw = RawScreen::into_raw_mode().unwrap();
let input = input();
for x in input.read_sync() {
match x {
InputEvent::Keyboard(KeyEvent::Esc) => break,
x => print!("\rRead: {:?}\n", x),
};
stdout().flush().unwrap();
}
} PlatformsThis process exited with status 0/normally is on these screenshots, because I hit the macOSUbuntu & lldbUbuntu & gdbUbuntu & VSCode & CodeLLDB |
In addition to the current woes of
read_sync
(e.g. #195) it seems we have an additional problem. When debugging using LLDB in Linux,read_sync
encounters an error that crashes the program. Here's the code:When run directly, it reads input events and prints them out, exiting if CTRL-C is pressed.
However, when running in VSCode's CodeLLDB debugger extension, I get a "No such device or address error". And when running under
lldb
on the command line, I get a SIGTTIN that stops the thread, halting the program.The program runs fine under
gdb
.In practice, this is crashing the input thread in my program whenever I attempt to debug using the usual tools. It could be that this is some LLDB error, or I am misusing LLDB somehow, but the behavior is very surprising so I thought I'd report it here.
The text was updated successfully, but these errors were encountered: