mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 21:21:15 -03:00
Allow fish_private_mode to change at runtime
Prior to this change, `fish_private_mode` worked by just suppressing history outright. With this change, `fish_private_mode` can be toggled on and off. Commands entered while `fish_private_mode` is set are stored but in memory only; they are not written to disk. Fixes #7590 Fixes #7589
This commit is contained in:
@@ -90,7 +90,6 @@ static const std::vector<electric_var_t> electric_variables{
|
||||
{L"_", electric_var_t::freadonly},
|
||||
{L"fish_kill_signal", electric_var_t::freadonly | electric_var_t::fcomputed},
|
||||
{L"fish_pid", electric_var_t::freadonly},
|
||||
{L"fish_private_mode", electric_var_t::freadonly},
|
||||
{L"history", electric_var_t::freadonly | electric_var_t::fcomputed},
|
||||
{L"hostname", electric_var_t::freadonly},
|
||||
{L"pipestatus", electric_var_t::freadonly | electric_var_t::fcomputed},
|
||||
@@ -119,8 +118,7 @@ static bool is_read_only(const wcstring &key) {
|
||||
if (auto ev = electric_var_t::for_name(key)) {
|
||||
return ev->readonly();
|
||||
}
|
||||
// Hack.
|
||||
return in_private_mode() && key == L"fish_history";
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Return true if a variable should become a path variable by default. See #436.
|
||||
|
||||
Reference in New Issue
Block a user