diff --git a/changelog.md b/changelog.md index faaa32a4..d3db9c19 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,11 @@ +TBD +============== + +Features +-------- +* Allow history file location to be configured. + + 1.44.2 (2026/01/13) ============== diff --git a/mycli/main.py b/mycli/main.py index 7258712c..82dcffa7 100755 --- a/mycli/main.py +++ b/mycli/main.py @@ -772,7 +772,7 @@ def run_cli(self) -> None: if self.smart_completion: self.refresh_completions() - history_file = os.path.expanduser(os.environ.get("MYCLI_HISTFILE", "~/.mycli-history")) + history_file = os.path.expanduser(os.environ.get("MYCLI_HISTFILE", self.config.get("history_file", "~/.mycli-history"))) if dir_path_exists(history_file): history = FileHistoryWithTimestamp(history_file) else: diff --git a/mycli/myclirc b/mycli/myclirc index 62353c9e..b49b81a6 100644 --- a/mycli/myclirc +++ b/mycli/myclirc @@ -27,6 +27,9 @@ multi_line = False # or "shutdown". destructive_warning = True +# interactive query history location. +history_file = ~/.mycli-history + # log_file location. log_file = ~/.mycli.log diff --git a/test/myclirc b/test/myclirc index f4f0ff09..5f3c5a01 100644 --- a/test/myclirc +++ b/test/myclirc @@ -27,6 +27,9 @@ multi_line = False # or "shutdown". destructive_warning = True +# interactive query history location. +history_file = ~/.mycli-history + # log_file location. log_file = ~/.mycli.test.log