From d67937332094a7d8de8e9bd2e112d30d117c50c0 Mon Sep 17 00:00:00 2001 From: Reid Priedhorsky <1682574+reidpr@users.noreply.github.com> Date: Tue, 19 Mar 2024 09:31:11 -0600 Subject: [PATCH] PR #1863: --break: nice error if stdin is not a TTY --- bin/ch-image.py.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/ch-image.py.in b/bin/ch-image.py.in index 166cb21ef..4871c90b9 100644 --- a/bin/ch-image.py.in +++ b/bin/ch-image.py.in @@ -415,6 +415,8 @@ if (__name__ == "__main__"): for (opt, arg) in zip(sys.argv[1:], sys.argv[2:] + [None]): (opt, _, arg_eq) = opt.partition("=") if (opt == "--break"): + if (not sys.stdin.isatty()): + ch.FATAL("--break: standard input must be a terminal") if (arg_eq != ""): arg = arg_eq try: