Skip to content

Commit 0b5a9cf

Browse files
committed
monitor: fix output error when exiting
When CTRL+C is pressed, terminal should be closed without spilling out any error. This fixes it. Signed-off-by: Sylvio Alves <[email protected]>
1 parent 023b034 commit 0b5a9cf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/idf_monitor/idf_monitor_base/console_reader.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,8 @@ def _cancel(self):
9494
# Note: This would throw exception in testing mode when the stdin is connected to PTY.
9595
import fcntl
9696
import termios
97-
fcntl.ioctl(self.console.fd, termios.TIOCSTI, b'\0')
97+
try:
98+
fcntl.ioctl(self.console.fd, termios.TIOCSTI, b'\0')
99+
except OSError:
100+
# ignore I/O errors when injecting the “unblock” byte
101+
pass

0 commit comments

Comments
 (0)