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

[bug]: Unexpected token error #1

Closed
3 tasks done
IgorGanapolsky opened this issue Jun 21, 2022 · 1 comment
Closed
3 tasks done

[bug]: Unexpected token error #1

IgorGanapolsky opened this issue Jun 21, 2022 · 1 comment
Labels
bug 🐞 Inconsistencies or issues which will cause a problem for users or implementors. triage 📑 The issue is awaiting investigation.

Comments

@IgorGanapolsky
Copy link

Environment

MacOS

Expected behavior

Should be able to run

source ~/.zshrc

Current behavior

When I run it, It gives an error:

bash: ${${0:#$ZSH_ARGZERO}:-${(%):-%N}}: bad substitution
bash: ${${(M)0:#/*}:-$PWD/$0}: bad substitution
bash: typeset: -g: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
bash: typeset: -g: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
bash: typeset: -g: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
bash: typeset: -g: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
bash: typeset: -g: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
bash: ${FAST_WORK_DIR}: bad substitution
mkdir: : No such file or directory
bash: /Users/ganapolsky/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh: line 129: syntax error near unexpected token )' bash: /Users/ganapolsky/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh: line 129: () {'
ganapolsky-macbookpro:
ganapolsky$ thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', library/std/src/io/stdio.rs:1017:9
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Steps to reproduce

Create a .zsh directory to store our plugins in one place

mkdir ~/.zsh

Clone repo to ~/.zsh/ directory

cd ~/.zsh && git clone git@github.com:zdharma/fast-syntax-highlighting.git

Enable 'fast-syntax-highlighting' plugin in ZSH

echo "source $HOME/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" >> ~/.zshrc

Reload ZSH

source ~/.zshrc

Code snippet

eval "$(starship init zsh)"
source $HOME/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh

Aditional information

Following the tutorial here:
https://tjay.dev/howto-my-terminal-shell-setup-hyper-js-zsh-starship/

Self-service

  • I'd be willing to address this documentation request myself.

Have you read the Contributing Guidelines?

Are you familiar with Contributor Covenant Code of Conduct?

Contact Details

iganapolsky@gmail.com

@IgorGanapolsky IgorGanapolsky added bug 🐞 Inconsistencies or issues which will cause a problem for users or implementors. triage 📑 The issue is awaiting investigation. labels Jun 21, 2022
@ss-o
Copy link

ss-o commented Jun 29, 2022

Hi 👋

This indicates that you running zsh script in a bash shell:

bash: ${${0:#

The tutorial has mistakes such as:

# Reload ZSH
source ~/.zshrc

Which does not reload the shell and simply sources the specified file.

Reload shell with:

exec zsh -il

I recommend checking the Zi. :octocat:

Sincerely,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Inconsistencies or issues which will cause a problem for users or implementors. triage 📑 The issue is awaiting investigation.
Projects
None yet
Development

No branches or pull requests

2 participants