termion issueshttps://gitlab.redox-os.org/redox-os/termion/-/issues2019-01-28T23:03:15Zhttps://gitlab.redox-os.org/redox-os/termion/-/issues/104Panics in escape sequence decoding2019-01-28T23:03:15ZMichael Aaron Murphymmstick@pm.mePanics in escape sequence decoding*Created by: le-jzr*
I noticed there is a ****load of unwraps in the code, most of which assume that the input matches the expected byte sequence without fail. This is a very bad idea, since it makes the whole program instantly crash wh...*Created by: le-jzr*
I noticed there is a ****load of unwraps in the code, most of which assume that the input matches the expected byte sequence without fail. This is a very bad idea, since it makes the whole program instantly crash whenever the terminal sends anything slightly nonstandard, and possibly with some standard but not-often-seen sequences too.https://gitlab.redox-os.org/redox-os/termion/-/issues/64Panic on piped input in raw mode2018-06-23T07:37:13ZMichael Aaron Murphymmstick@pm.mePanic on piped input in raw mode*Created by: aleksander*
termion 1.1.2
``` Rust
extern crate termion;
fn main() {
use termion::raw::IntoRawMode;
let mut _stdout = std::io::stdout().into_raw_mode().unwrap();
}
```
Running by 'echo "ABC" | app' causes panic:
...*Created by: aleksander*
termion 1.1.2
``` Rust
extern crate termion;
fn main() {
use termion::raw::IntoRawMode;
let mut _stdout = std::io::stdout().into_raw_mode().unwrap();
}
```
Running by 'echo "ABC" | app' causes panic:
```
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Custom(Custom { kind: Other, error: StringError("Unable to get Termios attribute.") }) }', ../src/libcore/result.rs:799
stack backtrace:
1: 0x565013a5493f - std::sys::backtrace::tracing::imp::write::h22f199c1dbb72ba2
2: 0x565013a5822d - std::panicking::default_hook::{{closure}}::h9a389c462b6a22dd
3: 0x565013a57532 - std::panicking::default_hook::h852b4223c1c00c59
4: 0x565013a57b28 - std::panicking::rust_panic_with_hook::hcd9d05f53fa0dafc
5: 0x565013a579c2 - std::panicking::begin_panic::hf6c488cee66e7f17
6: 0x565013a57900 - std::panicking::begin_panic_fmt::hb0a7126ee57cdd27
7: 0x565013a57881 - rust_begin_unwind
8: 0x565013a8ceef - core::panicking::panic_fmt::h9af671b78898cdba
9: 0x565013a2e28e - core::result::unwrap_failed::h3ea0c9548cd89371
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/macros.rs:29
10: 0x565013a299fe - <core::result::Result<T, E>>::unwrap::hdd81e7ca42639528
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/result.rs:737
11: 0x565013a36cb7 - tt::main::heca67ea268605a0c
at /tmp/tt/src/main.rs:5
12: 0x565013a5fcf6 - __rust_maybe_catch_panic
13: 0x565013a56db1 - std::rt::lang_start::h14cbded5fe3cd915
14: 0x565013a37373 - main
15: 0x7f78bb896290 - __libc_start_main
16: 0x565013a23969 - _start
17: 0x0 - <unknown>
```