From 5bfa0d7a9d078b7c9d15dd51e71fbd5998aad558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 26 Aug 2025 13:25:35 +0200 Subject: [PATCH] prompt: catch EOF errors --- pkgs/clan-cli/clan_cli/vars/prompt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/vars/prompt.py b/pkgs/clan-cli/clan_cli/vars/prompt.py index dd38789ba..81443073f 100644 --- a/pkgs/clan-cli/clan_cli/vars/prompt.py +++ b/pkgs/clan-cli/clan_cli/vars/prompt.py @@ -134,7 +134,7 @@ def _get_secret_input_with_confirmation( msg = f"Failed to confirm value for {ident} after {max_attempts} attempts." raise ClanError(msg) - except KeyboardInterrupt as e: + except (KeyboardInterrupt, EOFError) as e: msg = "User cancelled the input." raise ClanError(msg) from e @@ -175,7 +175,7 @@ def _get_regular_input(input_type: PromptType, text: str) -> str: case _: msg = f"Unsupported input type: {input_type}" raise ClanError(msg) - except KeyboardInterrupt as e: + except (KeyboardInterrupt, EOFError) as e: msg = "User cancelled the input." raise ClanError(msg) from e