Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History in XDG_DATA_HOME, configurable via Environment variable #1421

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion core/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,15 @@ 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())
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)
if mylib.PYTHON:
Expand Down
3 changes: 1 addition & 2 deletions oil-version.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
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
# It's used at build time for the release tarball, and at runtime for oil
# --version / osh --version.