-
Notifications
You must be signed in to change notification settings - Fork 9
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
Unexpected ParserError #12
Comments
I had a similar problem so I went digging:
Lines 46 to 52 in 6e6d8b7
Your Btw, you should use |
@Tim-Paik Sorry for not responding, I missed the github notification so I didn't see this before now. Do you have a full example I can have a look at? |
You can execute the following command to reproduce my problem
Populate
Looks like you're making sense, since I'm not providing a terminal width, which noline definitely needs. But I don't know how should I provide the size of the terminal... |
Noline expects to be connected to an ANSI terminal. During init, noline probes the terminal using ANSI escape codes to get the size of the terminal. You can have a look at here for an example of a mockterminal. But, what is your use case here? Without an actual terminal, noline isn't of much use. |
Not entirely sure if related, but I'm consistently getting this panic on the let mut editor = EditorBuilder::from_slice(&mut buffer)
.with_slice_history(&mut history)
.build_sync(&mut io)
.unwrap(); I had to modify the example slightly for it to work on the second attempt: let mut editor = loop {
break match EditorBuilder::from_slice(&mut buffer)
.with_slice_history(&mut history)
.build_sync(&mut io) {
Ok(ed) => ed,
Err(err) => {
let error = match err {
NolineError::IoError(_) => "IoError",
NolineError::ParserError => "ParseError",
NolineError::Aborted=> "Aborted",
};
writeln!(io, "Error: {}\r", error).unwrap();
continue;
}
}
}; Now it works, but the error still happens:
Is this something that's fixable on |
I would need to be able to reproduce this in order to debug it. Could you provide more details of your setup:
|
Thanks!
Linux 6.10.8 (archlinux)
Yes, I've tried minicom and screen, same thing on both.
This is a straight USB connection to the rp-pico (using rp2040 usb serial example). |
Thanks! I don't have an RP pico here now, but I'll try to bring one tomorrow and have look. |
I've done some testing, and it appears that when using minicom the serial port is opened for read/write before configuring it, which means that I guess noline should be a bit more robust in the face of unexpected data, but I'm not sure how this should be handled. |
I'm having some issues trying to use this crate to make an interaction for my no_std project.
I tried implementing my own IO type (for my environment), but always panic when building the editor:
here is my code:
Did I write something wrong? It looks like everything works fine
The text was updated successfully, but these errors were encountered: