diff --git a/frappy/client/interactive.py b/frappy/client/interactive.py index ebc6e59b..2b604af3 100644 --- a/frappy/client/interactive.py +++ b/frappy/client/interactive.py @@ -29,7 +29,7 @@ import os import traceback import threading import logging -from os.path import expanduser +from pathlib import Path from frappy.lib import delayed_import from frappy.client import SecopClient, UnregisterCallback from frappy.errors import SECoPError @@ -497,7 +497,7 @@ class Console(code.InteractiveConsole): history = None if readline: try: - history = expanduser(f'~/.config/frappy/{name}-history') + history = Path(f'~/.local/state/frappy-{name}-history').expanduser() readline.read_history_file(history) except FileNotFoundError: pass @@ -505,6 +505,7 @@ class Console(code.InteractiveConsole): self.interact('', '') finally: if history: + history.parent.mkdir(mode=0o700, parents=True, exist_ok=True) readline.write_history_file(history) def raw_input(self, prompt=""):