Skip to content

shell: Allow to configure history and init files path via env vars#273

Merged
dnicolodi merged 2 commits intobeancount:masterfrom
dnicolodi:history-filename
Apr 5, 2026
Merged

shell: Allow to configure history and init files path via env vars#273
dnicolodi merged 2 commits intobeancount:masterfrom
dnicolodi:history-filename

Conversation

@dnicolodi
Copy link
Copy Markdown
Collaborator

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.

@dnicolodi dnicolodi force-pushed the history-filename branch 3 times, most recently from 741c661 to b2de0c7 Compare March 28, 2026 18:02
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.
@dnicolodi dnicolodi merged commit 83c375c into beancount:master Apr 5, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make HISTORY_FILENAME overriddable and/or location specific

1 participant