From 9feaa4925634d847b238844786690046bbaacbbd Mon Sep 17 00:00:00 2001 From: Eli Array Minkoff Date: Tue, 27 Sep 2022 13:58:41 -0400 Subject: [PATCH 1/5] Respect HISTFILE_OSH/_OIL and move history file --- core/shell.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/shell.py b/core/shell.py index 3ea613cead..e18c36582c 100644 --- a/core/shell.py +++ b/core/shell.py @@ -615,8 +615,16 @@ def Main(lang, arg_r, environ, login_shell, loader, line_input): debug_f, line_input) # type: comp_ui._IDisplay else: display = comp_ui.MinimalDisplay(comp_ui_state, prompt_state, debug_f) + if 'HISTFILE_%s' % lang.upper() in environ: + history_filename = environ.get('HISTFILE_%s' % lang.upper()) + print(repr(history_filename)) + elif 'XDG_DATA_HOME' in environ: + history_filename = os_path.join( + environ.get('XDG_DATA_HOME'), 'oil/history_%s' % lang) + else: + history_filename = os_path.join( + home_dir, '.local/share/oil/history_%s' % lang) - history_filename = os_path.join(home_dir, '.config/oil/history_%s' % lang) comp_ui.InitReadline(line_input, history_filename, root_comp, display, debug_f) _InitDefaultCompletions(cmd_ev, complete_builtin, comp_lookup) From 0b6903d45eb72165721daa277b481e7ee846e728 Mon Sep 17 00:00:00 2001 From: Eli Array Minkoff Date: Thu, 29 Sep 2022 11:42:08 -0400 Subject: [PATCH 2/5] Update version from 0.12.6 to 0.12.6-hist --- oil-version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oil-version.txt b/oil-version.txt index 313527b040..2406f7db36 100644 --- a/oil-version.txt +++ b/oil-version.txt @@ -1,4 +1,4 @@ -0.12.6 +0.12.6-hist # The first line of this file is the Oil version, and the rest is ignored. # It's used at build time for the release tarball, and at runtime for oil From f3444d294c4f8cc5ba6d16c4e3ce35507a6fcbf1 Mon Sep 17 00:00:00 2001 From: Eli Array Minkoff Date: Tue, 25 Oct 2022 10:01:48 -0400 Subject: [PATCH 3/5] Update oil-version --- oil-version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oil-version.txt b/oil-version.txt index e20f714382..a38511f92d 100644 --- a/oil-version.txt +++ b/oil-version.txt @@ -1,6 +1,6 @@ 0.12.8-hist # The first line of this file is the Oil version, and the rest is ignored. -# It's used at build time for the release tarball, and at runtime for oil +# It's used at build time for the release tarball, and at runtime for oil # --version / osh --version. From 6e36c00bfaaa1f32e8a6cc8d188574e1f91a358a Mon Sep 17 00:00:00 2001 From: Eli Array Minkoff Date: Mon, 5 Dec 2022 10:41:48 -0500 Subject: [PATCH 4/5] Remove debug print --- core/shell.py | 1 - 1 file changed, 1 deletion(-) diff --git a/core/shell.py b/core/shell.py index e0ce9fa97a..fcdb9088d6 100644 --- a/core/shell.py +++ b/core/shell.py @@ -611,7 +611,6 @@ def Main(lang, arg_r, environ, login_shell, loader, line_input): display = comp_ui.MinimalDisplay(comp_ui_state, prompt_state, debug_f) if 'HISTFILE_%s' % lang.upper() in environ: history_filename = environ.get('HISTFILE_%s' % lang.upper()) - print(repr(history_filename)) elif 'XDG_DATA_HOME' in environ: history_filename = os_path.join( environ.get('XDG_DATA_HOME'), 'oil/history_%s' % lang) From eb3c4299939e43f6ea9bd8a35909beb6a3da1fa6 Mon Sep 17 00:00:00 2001 From: Eli Array Minkoff Date: Wed, 7 Dec 2022 14:06:30 -0500 Subject: [PATCH 5/5] Remove `-hist` from version identifier --- oil-version.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/oil-version.txt b/oil-version.txt index 1c9c84f421..fb980ffe5f 100644 --- a/oil-version.txt +++ b/oil-version.txt @@ -1,5 +1,4 @@ -0.12.9-hist - +0.12.9 # The first line of this file is the Oil version, and the rest is ignored. # It's used at build time for the release tarball, and at runtime for oil # --version / osh --version.