aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/fish_key_reader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fish_key_reader.cpp')
-rw-r--r--src/fish_key_reader.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fish_key_reader.cpp b/src/fish_key_reader.cpp
index 0051ebb4..72d550c2 100644
--- a/src/fish_key_reader.cpp
+++ b/src/fish_key_reader.cpp
@@ -281,6 +281,11 @@ int main(int argc, char **argv) {
return 1;
}
+ if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO)) {
+ fprintf(stderr, "Stdin and stdout must be attached to a tty, redirection not allowed.\n");
+ return 1;
+ }
+
setup_and_process_keys(continuous_mode);
return 0;
}