mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 13:11:15 -03:00
Save history on exec
See https://github.com/fish-shell/fish-shell/issues/907 May not fully resolve the issue, needs to be tested before #907 can be closed.
This commit is contained in:
@@ -382,6 +382,14 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
const struct config_paths_t paths = determine_config_directory_paths(argv[0]);
|
||||
|
||||
// save history both on exit and on exec
|
||||
if (is_interactive_session) {
|
||||
before_exit.emplace([=]() {
|
||||
history_save_all();
|
||||
});
|
||||
}
|
||||
|
||||
env_init(&paths);
|
||||
// Set features early in case other initialization depends on them.
|
||||
// Start with the ones set in the environment, then those set on the command line (so the
|
||||
@@ -472,7 +480,6 @@ int main(int argc, char **argv) {
|
||||
before_exit.pop();
|
||||
}
|
||||
|
||||
history_save_all();
|
||||
proc_destroy();
|
||||
exit_without_destructors(exit_status);
|
||||
return EXIT_FAILURE; // above line should always exit
|
||||
|
||||
Reference in New Issue
Block a user