1diff --git a/test/lsp.py b/test/lsp.py
2index 669951ca4..11007ae82 100755
3--- a/test/lsp.py
4+++ b/test/lsp.py
5@@ -28,7 +28,8 @@ else:
6 import tty
7 # Turn off user input buffering so we get the input immediately,
8 # not only after a line break
9- tty.setcbreak(sys.stdin.fileno())
10+ if os.isatty(sys.stdin.fileno()):
11+ tty.setcbreak(sys.stdin.fileno())
12
13
14 # Type for the pure test name without .sol suffix or sub directory