mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-28 21:41:15 -03:00
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:
committed by
Kurtis Rader
parent
6f6a4a842c
commit
aec0973196
@@ -614,6 +614,9 @@ static void react_to_variable_change(const wcstring &key) {
|
||||
invalidate_termsize(true); // force fish to update its idea of the terminal size plus vars
|
||||
} else if (key == L"FISH_READ_BYTE_LIMIT") {
|
||||
env_set_read_limit();
|
||||
} else if (key == L"FISH_HISTFILE") {
|
||||
history_destroy();
|
||||
reader_push(history_session_id().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1178,7 +1181,7 @@ env_var_t env_get_string(const wcstring &key, env_mode_flags_t mode) {
|
||||
|
||||
history_t *history = reader_get_history();
|
||||
if (!history) {
|
||||
history = &history_t::history_with_name(L"fish");
|
||||
history = &history_t::history_with_name(history_session_id());
|
||||
}
|
||||
if (history) history->get_string_representation(&result, ARRAY_SEP_STR);
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user