Make the history session configurable

Using the FISH_HISTFILE variable will let people customise the session
to use for the history file. The resulting history file is:

    `$XDG_DATA_HOME/fish/name_history`

Where `name` is the name of the session. The default value is `fish`
which results in the current history file.

If it's set to an empty string, the history will not be stored to a
file.

Fixes #102
This commit is contained in:
tomassedovic
2017-06-30 17:13:02 -07:00
committed by Kurtis Rader
parent 6f6a4a842c
commit aec0973196
12 changed files with 213 additions and 16 deletions

View File

@@ -2240,7 +2240,7 @@ static bool selection_is_at_top() {
/// Read interactively. Read input from stdin while providing editing facilities.
static int read_i(void) {
reader_push(L"fish");
reader_push(history_session_id().c_str());
reader_set_complete_function(&complete);
reader_set_highlight_function(&highlight_shell);
reader_set_test_function(&reader_shell_test);