Skip to content

Commit a7a8818

Browse files
committed
Check is_terminal
1 parent 0f4cb94 commit a7a8818

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use anyhow::{bail, Context, Result};
22
use app_state::StateFileStatus;
33
use clap::{Parser, Subcommand};
44
use std::{
5-
io::{self, BufRead, StdoutLock, Write},
5+
io::{self, BufRead, IsTerminal, StdoutLock, Write},
66
path::Path,
77
process::exit,
88
};
@@ -148,6 +148,10 @@ fn main() -> Result<()> {
148148

149149
match args.command {
150150
None => {
151+
if !io::stdout().is_terminal() {
152+
bail!("Unsupported or missing terminal/TTY");
153+
}
154+
151155
let notify_exercise_names = if args.manual_run {
152156
None
153157
} else {

0 commit comments

Comments
 (0)