[F] Fix terminal stuck in raw mode

https://github.com/hykilpikonna/hyfetch/issues/41
This commit is contained in:
Hykilpikonna 2022-11-20 22:53:37 -05:00
parent 4ed6e3d7cc
commit 5b9271e7e5
No known key found for this signature in database
GPG key ID: 256CD01A41D7FA26

View file

@ -116,6 +116,8 @@ def unix_read_osc(seq: int) -> str:
# Wait for input to appear
if not select([sys.stdin], [], [], timeout)[0]:
# Reset terminal back to normal mode (previously set to raw mode)
termios.tcsetattr(fd, termios.TCSADRAIN, settings)
raise OSCException("No response received")
# Read until termination, or if it doesn't terminate, read until 1 second passes