MovingtoMars / liner

A readline-like library in Rust.
MIT License
74 stars 24 forks source link

Redirection of stdin results in panic on unrwrap() #77

Open OdysseusGE opened 6 years ago

OdysseusGE commented 6 years ago

For example echo foo | ./target/debug/liner_test gives:

thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 25, kind: Other, message: "Inappropriate ioctl for device" }', libcore/result.rs:916:5

The problematic unwrap is at src/context.rs:95, which calls let stdout = stdout().into_raw_mode().unwrap();

This issue also causes redox-os/ion to panic with a redirected stdin. See also: https://github.com/ticki/termion/issues/39

P-E-Meunier commented 6 years ago

We're having the same problem on Pijul.