From 42364283ba3f34d16f540d064aea5247b6cf4431 Mon Sep 17 00:00:00 2001 From: Anand Swaroop <72886192+Anut-py@users.noreply.github.com> Date: Fri, 19 Dec 2025 18:17:07 -0500 Subject: [PATCH] fix: stdin reopening for windows --- khard/khard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/khard/khard.py b/khard/khard.py index 5caf9329..ff6ab0a4 100644 --- a/khard/khard.py +++ b/khard/khard.py @@ -1157,7 +1157,8 @@ def main(argv: list[str] = sys.argv[1:]) -> ExitStatus: # otherwise further user interaction is not possible (for example # selecting a contact from the contact table) try: - sys.stdin = open('/dev/tty') + tty_name = 'CONIN$' if os.name == 'nt' else '/dev/tty' + sys.stdin = open(tty_name, 'r') except OSError: pass