8000 fix 3 instances of old command substitution `$()` by mwartell · Pull Request #9569 · fish-shell/fish-shell · GitHub
[go: up one dir, main page]

Skip to content

fix 3 instances of old command substitution $()#9569

Merged
faho merged 1 commit intofish-shell:masterfrom
mwartell:fix-darwin-prompt-subcommand-syntax
Feb 12, 2023
Merged

fix 3 instances of old command substitution $()#9569
faho merged 1 commit intofish-shell:masterfrom
mwartell:fix-darwin-prompt-subcommand-syntax

Conversation

@mwartell
Copy link
Contributor

Description

On installation of fish 3.6.0 on Linux, every prompt fails with a syntax error

/usr/share/fish/functions/fish_git_prompt.fish (line 173): $(...) is not supported. In fish, please use '(uname)'.
if string match -q Darwin -- "$(uname)" && string match -q /usr/bin/git -- "$(command -s git)" && type -q xcode-select && type -q xcrun
                              ^
from sourcing file /usr/share/fish/functions/fish_git_prompt.fish
        called on line 1 of file ~/.config/fish/functions/fish_prompt.fish
in command substitution
        called on line 1 of file ~/.config/fish/functions/fish_prompt.fish
in command substitution
        called on line 28 of file ~/.config/fish/functions/fish_prompt.fish
in function 'fish_prompt'
in command substitution

The commit a77bc70 added those old-style substitutions.

Fixes issue #

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

@faho
Copy link
Member
faho commented Feb 12, 2023

On installation of fish 3.6.0 on Linux, every prompt fails with a syntax error

The reason this happens is that you have an old fish running - pre-3.4.

What you need to do, basically after every fish update, is to stop these old fishes and restart them with the new version. This is a consequence of autoloading - there is no way to tell the old fish to never load a new function.

That being said: In this specific case it's not a big deal to just use the old style a bit longer, so I'll be merging this.

@faho faho added this to the fish 3.6.1 milestone Feb 12, 2023
@faho faho merged commit 904839d into fish-shell:master Feb 12, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0