state.rs: show error description when TIOCGWINSZ ioctl fails
In some situations, we're not compatible with the terminal. Show an error with details when the terminal size request happens. Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>pull/306/head
parent
d3cbf184e6
commit
e1b55340fa
|
@ -357,9 +357,11 @@ impl State {
|
|||
}
|
||||
*/
|
||||
|
||||
let termsize = termion::terminal_size()?;
|
||||
let cols = termsize.0 as usize;
|
||||
let rows = termsize.1 as usize;
|
||||
let (cols, rows) = termion::terminal_size().chain_err_summary(|| {
|
||||
"Could not determine terminal size. Are you running this on a tty? If yes, do you need \
|
||||
permissions for tty ioctls?"
|
||||
})?;
|
||||
let (cols, rows) = (cols as usize, rows as usize);
|
||||
|
||||
let job_executor = Arc::new(JobExecutor::new(sender.clone()));
|
||||
let accounts = {
|
||||
|
|
Loading…
Reference in New Issue