mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 21:31:14 -03:00
Hardcode $PWD as read-only for set --show
Through a mechanism I don't entirely understand, $PWD is sometimes writable (so that `cd` can change it) and sometimes not. In this case we ended up with it writable, which is wrong. See #8179.
This commit is contained in:
@@ -512,7 +512,9 @@ static void show_scope(const wchar_t *var_name, int scope, io_streams_t &streams
|
||||
wcstring_list_t vals = var->as_list();
|
||||
streams.out.append_format(_(L"$%ls: set in %ls scope, %ls,%ls with %d elements\n"), var_name,
|
||||
scope_name, exportv, pathvarv, vals.size());
|
||||
if (var->read_only()) {
|
||||
// HACK: PWD can be set, depending on how you ask.
|
||||
// For our purposes it's read-only.
|
||||
if (var->read_only() || wcscmp(var_name, L"PWD") == 0) {
|
||||
streams.out.append(_(L"Variable is read-only\n"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user