| 1 | Patch-Source: https://github.com/AlexanderThaller/hstdb/pull/55
|
| 2 | --
|
| 3 | From edd0899c6a53db041972a3411c0973d291b1cf77 Mon Sep 17 00:00:00 2001
|
| 4 | From: Jakub Jirutka <[email protected]>
|
| 5 | Date: Sun, 12 Mar 2023 19:36:37 +0100
|
| 6 | Subject: [PATCH] Get default histfile path from HISTFILE env. variable if
|
| 7 | exists
|
| 8 |
|
| 9 | This is the standard Zsh variable to define the histfile location.
|
| 10 | ---
|
| 11 | src/opt.rs | 8 +++++---
|
| 12 | 1 file changed, 5 insertions(+), 3 deletions(-)
|
| 13 |
|
| 14 | diff --git a/src/opt.rs b/src/opt.rs
|
| 15 | index af7fb97..91cae47 100644
|
| 16 | |
| 17 | |
| 18 | @@ -70,9 +70,11 @@ fn default_histdb_sqlite_path() -> PathBuf {
|
| 19 | }
|
| 20 |
|
| 21 | fn default_zsh_histfile_path() -> PathBuf {
|
| 22 | - let base_dirs = base_directory();
|
| 23 | - let home = base_dirs.home_dir();
|
| 24 | - home.join(".histfile")
|
| 25 | + std::env::var_os("HISTFILE").map(PathBuf::from).unwrap_or_else(|| {
|
| 26 | + let base_dirs = base_directory();
|
| 27 | + let home = base_dirs.home_dir();
|
| 28 | + home.join(".histfile")
|
| 29 | + })
|
| 30 | }
|
| 31 |
|
| 32 | fn default_socket_path() -> PathBuf {
|
| 33 |
|