replace tty check with crossterm

This commit is contained in:
Carson McManus 2022-06-25 11:01:40 -04:00
parent 5a262650a0
commit 0b340a3cf1

View file

@ -7,6 +7,7 @@ use std::{
path::Path, path::Path,
sync::{Arc, Mutex}, sync::{Arc, Mutex},
}; };
use crossterm::tty::IsTty;
use steamguard::{ use steamguard::{
steamapi, AccountLinkError, AccountLinker, Confirmation, ExposeSecret, FinalizeLinkError, steamapi, AccountLinkError, AccountLinker, Confirmation, ExposeSecret, FinalizeLinkError,
LoginError, SteamGuardAccount, UserLogin, LoginError, SteamGuardAccount, UserLogin,
@ -522,7 +523,7 @@ fn do_subcmd_trade(
} }
} }
} else { } else {
if termion::is_tty(&stdout()) { if stdout().is_tty() {
let (accept, deny) = tui::prompt_confirmation_menu(confirmations)?; let (accept, deny) = tui::prompt_confirmation_menu(confirmations)?;
for conf in &accept { for conf in &accept {
let result = account.accept_confirmation(conf); let result = account.accept_confirmation(conf);