mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-07-03 10:01:16 -03:00
Set $fish_private_mode and show a message on private mode startup
The message can be localized and is set as a global variable shadowing the universally-defined $fish_greeting.
This commit is contained in:
committed by
Fabian Homborg
parent
379f44fabe
commit
ebb3a3a16e
@@ -296,7 +296,8 @@ bool string_set_contains(const T &set, const wchar_t *val) {
|
||||
|
||||
/// Check if a variable may not be set using the set command.
|
||||
static bool is_read_only(const wchar_t *val) {
|
||||
const string_set_t env_read_only = {L"PWD", L"SHLVL", L"history", L"status", L"version", L"fish_pid", L"hostname", L"_"};
|
||||
const string_set_t env_read_only = {L"PWD", L"SHLVL", L"history", L"status", L"version",
|
||||
L"fish_pid", L"hostname", L"_", L"fish_private_mode"};
|
||||
return string_set_contains(env_read_only, val) ||
|
||||
(in_private_mode() && wcscmp(L"fish_history", val) == 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user