diff --git a/setups/owl/setup.sh b/setups/owl/setup.sh index c4db51b..494ce33 100755 --- a/setups/owl/setup.sh +++ b/setups/owl/setup.sh @@ -36,5 +36,6 @@ echo "Linked owl to ~/.local/bin/owl" # Ensure ~/.local/bin is in PATH for this session export PATH="$HOME/.local/bin:$PATH" -owl nest all +# Redirect stdin from /dev/tty to allow interactive nest selection even when piped from curl +owl nest all < /dev/tty diff --git a/src/main.rs b/src/main.rs index 1ebb51d..7fefe22 100644 --- a/src/main.rs +++ b/src/main.rs @@ -875,6 +875,17 @@ fn get_nest() -> Setup { } fn switch_nest() -> Setup { + use std::io::IsTerminal; + + if !std::io::stdin().is_terminal() { + eprintln!( + "{}", + "No nest configured and stdin is not interactive.".red() + ); + eprintln!("Run: {} < /dev/tty", "owl nest switch".cyan()); + std::process::exit(1); + } + let mut config = get_config(); let nests = list_nests();