shell: Allow to configure history and init files path via env vars#273
Merged
dnicolodi merged 2 commits intobeancount:masterfrom Apr 5, 2026
Merged
shell: Allow to configure history and init files path via env vars#273dnicolodi merged 2 commits intobeancount:masterfrom
dnicolodi merged 2 commits intobeancount:masterfrom
Conversation
741c661 to
b2de0c7
Compare
Allow to customize the location of the shell history files via the BEANQUERY_HISTORY environment variables. The environment variable name has been chosen to resemble the ones used by sqlite3 and psql, but with the BEANQUERY_ prefix. Setting this environment variable to the empty string disable saving the shell history. Similarly, allow to customize the location of the init file via the BEANQUERY_INIT environment variable. Setting this environment variable to the empty string disable processing of the init file. Furthermore, respect the XGD_CONFIG_HOME environment variable when determining the default location of these files. Tilde expansion is performed on the values of all environment variables: a leading path component equal to ~ is expanded to the user's home directory location. Fixes beancount#272.
b2de0c7 to
94e0f9e
Compare
94e0f9e to
0b48a34
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow to customize the location of the shell history files via the BEANQUERY_HISTORY environment variables. The environment variable name has been chosen to resemble the ones used by sqlite3 and psql, but with the BEANQUERY_ prefix.
Similarly, allow to customize the location of the init file via the BEANQUERY_INIT environment variable.
Furthermore, respect the XGD_CONFIG_HOME environment variable when determining the default location of these files.
Tilde expansion is performed on the values of all environment variables: a leading path component equal to ~ is expanded to the user's home directory location.
Fixes #272.