Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Fish shell, or don't try to install into Fish with ZSH syntax #417

Open
JakeWharton opened this issue Oct 10, 2024 · 2 comments
Open

Comments

@JakeWharton
Copy link

Hi! My corporate spyware MDM software has forced this tool onto my system. This would be fine, except that you install shell support into Fish using ZSH syntax.

This is in my ~/.config/fish/config.fish:

# Generated by Hermit; START; DO NOT EDIT.
HERMIT_ROOT_BIN="${HERMIT_ROOT_BIN:-"$HOME/bin/hermit"}"
eval "$(test -x $HERMIT_ROOT_BIN && $HERMIT_ROOT_BIN shell-hooks --print --zsh)"
# Generated by Hermit; END; DO NOT EDIT.
######

This causes Fish to produce this error:

~/.config/fish/config.fish (line 8): Unsupported use of '='. In fish, please use 'set HERMIT_ROOT_BIN "${HERMIT_ROOT_BIN:-"$HOME/bin/hermit"}"'.
HERMIT_ROOT_BIN="${HERMIT_ROOT_BIN:-"$HOME/bin/hermit"}"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
from sourcing file ~/.config/fish/config.fish
source: Error while reading file '/Users/jw/.config/fish/config.fish'

I checked for --fish, but it doesn't exist:

~/bin/hermit shell-hooks --print --fish
Usage: hermit shell-hooks (install-hooks)

Manage Hermit auto-activation hooks of a shell.

Flags:
  -h, --help                 Show context-sensitive help.
      --version              Show version.
  -d, --debug                Enable debug logging.
  -t, --trace                Enable trace logging.
  -q, --quiet                Disable logging and progress UI, except fatal errors ($HERMIT_QUIET).
      --level=auto           Set minimum log level (auto,trace,debug,info,warn,error,fatal) ($HERMIT_LOG).
      --lock-timeout=30s     Timeout for waiting on the lock ($HERMIT_LOCK_TIMEOUT)
      --env=KEY=VALUE;...    Extra environment variables to apply to environments.

Command flags:
  --zsh     Update Zsh hooks.
  --bash    Update Bash hooks.

hermit: error: unknown flag --fish, did you mean one of "--zsh", "--bash"?

Please either:

  • Add --fish output for shell hooks, or
  • Do not install into Fish until shell hooks are supported for Fish.
@alecthomas
Copy link
Collaborator

I don't believe it is Hermit doing this, it doesn't know about ~/.config/fish/config.fish at all. IIUC this is something done explicitly by the internal tooling :(

@JakeWharton
Copy link
Author

Ah, that's good to know. Thanks! I'm chasing them down for other invalid syntax they put into that file, so I'll be sure to mention this, too.

You can strikethrough like 90% of the original issue and keep it solely as a simple feature request for --fish if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants