mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 10:01:14 -03:00
builtin fish_indent/fish_key_reader: call help from existing fish process
Something like PATH=mypath builtin fish_indent --help runs "fish -c '__fish_print_help fish_indent'" internally. Since we don't call setenv(), the PATH update doesn't reach the child shell. Fix this by using what other builtins use if we are one (i.e. if we have a Parser in context). Fixes #12229 Maybe also #12085
This commit is contained in:
@@ -656,3 +656,9 @@ printf %s\n a b c | builtin fish_indent | grep b
|
||||
# Regression test that fish_indent doesn't panic with closed stdin.
|
||||
fish_indent <&-
|
||||
# CHECKERR: fish_indent: stdin is closed
|
||||
|
||||
function __fish_print_help
|
||||
echo Help using PATH[1]=$PATH[1]
|
||||
end
|
||||
PATH=hello fish_indent --help
|
||||
# CHECK: Help using PATH[1]=hello
|
||||
|
||||
Reference in New Issue
Block a user