mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
Do not add silent mode history items to history
Prior to this fix, if you invoked fish with --private and then used `read --silent` to read something sensitive, the variable would be stored in history, with the plain text available through up-arrow. Fix it to not store items in silent mode. Note the item was never written to disk; it was only stored in memory. Fixes #7230
This commit is contained in:
parent
caf64fd0ce
commit
81d5a3ea64
1 changed files with 2 additions and 2 deletions
|
@ -3018,9 +3018,9 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
|
|||
|
||||
if (command_test_result == 0) {
|
||||
// Finished command, execute it. Don't add items that start with a leading
|
||||
// space.
|
||||
// space, or if in silent mode (#7230).
|
||||
const editable_line_t *el = &command_line;
|
||||
if (history != nullptr && may_add_to_history(el->text())) {
|
||||
if (history != nullptr && !silent && may_add_to_history(el->text())) {
|
||||
history->add_pending_with_file_detection(el->text(), vars.get_pwd_slash());
|
||||
}
|
||||
rls.finished = true;
|
||||
|
|
Loading…
Reference in a new issue