diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ecf562eb..16a8b05d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - `switch` now allows arguments that expand to nothing, like empty variables (#5677). - The null command (:) now always exits successfully, rather than echoing last return code. - Cursor configuration instructions for vi-mode have been added to the fish documentation. +- A bug caused fish to rewrite the history file on every command. This has been fixed: fish will append to the file in most cases (#6042). ### Syntax changes and new commands - Brace expansion now only takes place if the braces include a "," or a variable expansion, so things like `git reset HEAD@{0}` now work (#5869). diff --git a/src/history.cpp b/src/history.cpp index e69ddd643..151aff6f0 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -947,6 +947,8 @@ bool history_impl_t::save_internal_via_appending() { this->history_file_id = file_id_for_fd(history_fd); close(history_fd); + + ok = (err == 0); } // If someone has replaced the file, forget our file state.