From 08f6a51eb48308ae399c2052d160f7393960f2b5 Mon Sep 17 00:00:00 2001 From: a-ramses Date: Fri, 10 Apr 2026 22:24:51 +0200 Subject: [PATCH] shell: handle PermissionError when reading history file Print a warning with a hint on how to clear extended attributes instead of silently ignoring the error. Signed-off-by: a-ramses --- proxyclient/m1n1/shell.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxyclient/m1n1/shell.py b/proxyclient/m1n1/shell.py index 451a0c3aa..0969d1498 100644 --- a/proxyclient/m1n1/shell.py +++ b/proxyclient/m1n1/shell.py @@ -27,6 +27,11 @@ def init_history(self, histfile): readline.read_history_file(histfile) except FileNotFoundError: pass + except PermissionError as e: + print(f"Failed reading history from {histfile}: {e}", file=sys.stderr) + if sys.platform == "darwin": + print(f" On macOS this may be caused by extended attributes. " + f"Try: xattr -c {histfile}", file=sys.stderr) def save_history(self): readline.set_history_length(10000)