From 509e48746421ec18f1da8fa6b68ab8fe5aa768ea Mon Sep 17 00:00:00 2001 From: awe Date: Tue, 9 Jun 2026 18:13:01 +0300 Subject: [PATCH] fix --- rfg_vna_viewer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rfg_vna_viewer.py b/rfg_vna_viewer.py index 9d32571..413db7b 100644 --- a/rfg_vna_viewer.py +++ b/rfg_vna_viewer.py @@ -41,10 +41,15 @@ DATA_PATH = "/tmp/ttyADC_data" # DataReader # --------------------------------------------------------------------------- class DataReader: - """Non-blocking raw reader for /tmp/ttyADC_data.""" + """Non-blocking raw reader for /tmp/ttyADC_data (PTY-safe).""" def __init__(self, path=DATA_PATH): + import termios, tty self._fd = os.open(path, os.O_RDONLY | os.O_NOCTTY) + try: + tty.setraw(self._fd) # disable line discipline processing + except termios.error: + pass # not a TTY — fine, skip os.set_blocking(self._fd, False) def read_available(self):