Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fish-foreign-env: suppress additional harmless warnings
As per #30645, fish with fish-foreign-env prints this (harmless) warning: ``` set: Tried to change the read-only variable “_” ``` This patch was developed by @rnhmjoj in the aforementioned issue discussion (cherry picked from commit edfdc1d)
- Loading branch information
Showing
2 changed files
with
13 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 12 additions & 5 deletions
17
...fish-foreign-env/hide-path-warnings.patch → ...eign-env/suppress-harmless-warnings.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
diff --git a/functions/fenv.apply.fish b/functions/fenv.apply.fish | ||
index 34a25e3..6837e7f 100644 | ||
index 34a25e3..3d94135 100644 | ||
--- a/functions/fenv.apply.fish | ||
+++ b/functions/fenv.apply.fish | ||
@@ -30,8 +30,9 @@ function fenv.apply | ||
@@ -27,11 +27,17 @@ function fenv.apply | ||
for variable in $variables | ||
set key (echo $variable | sed 's/=.*//') | ||
set value (echo $variable | sed 's/[^=]*=//') | ||
+ set ignore PATH _ | ||
|
||
if test "$key" = 'PATH' | ||
set value (echo $value | tr ':' '\n') | ||
end | ||
|
||
- set -g -x $key $value | ||
+ if contains $key $ignore | ||
+ set -g -x $key $value ^/dev/null | ||
+ else | ||
+ set -g -x $key $value | ||
end | ||
- | ||
- set -g -x $key $value | ||
+ end | ||
+ | ||
end | ||
end |