Skip to content

zsh function .zwc parse errors  #742

Open
@bengolder

Description

@bengolder

After installing, I get errors every time I open a new iTerm window:

/Users/bengolder/.zsh/functions/_git_delete_branch.zwc:1: parse error near `)'
/Users/bengolder/.zsh/functions/change-extension.zwc:1: no such file or directory: ^G^F^E^D^A^H^A
/Users/bengolder/.zsh/functions/envup.zwc:1: no such file or directory: ^G^F^E^D^Ax^A
[3] 75334
/Users/bengolder/.zsh/functions/g.zwc:1: no such file or directory: ^G^F^E^D^A
[4] 75335
/Users/bengolder/.zsh/functions/g.zwc:1: no such file or directory:
[4]  + exit 127    ��
[3]  + exit 127    �A
/Users/bengolder/.zsh/functions/g.zwc:1: command not found: A
/Users/bengolder/.zsh/functions/mcd.zwc:1: no such file or directory: ^G^F^E^D^A\M-T
Wed Apr 24 10:42 AM ~ %

It's clear that these are occurring when the zshrc file runs this loop to source all the files in .zsh/functions:

# load custom executable functions
for function in ~/.zsh/functions/*; do
  source $function
done

If I delete the ~/.zsh directory and rerun rcup, the errors are absent until new .zwc files are autogenerated for each file in ~/.zsh/functions:

Wed Apr 24 10:49 AM functions % pwd
/Users/bengolder/.zsh/functions
Wed Apr 24 10:49 AM functions % ls -la
total 40
drwxr-xr-x  12 bengolder  staff  384 Apr 24 10:47 .
drwxr-xr-x   5 bengolder  staff  160 Apr 24 10:46 ..
lrwxr-xr-x   1 bengolder  staff   58 Apr 24 10:46 _git_delete_branch -> /Users/bengolder/dotfiles/zsh/functions/_git_delete_branch
-rw-r-----   1 bengolder  staff  480 Apr 24 10:47 _git_delete_branch.zwc
lrwxr-xr-x   1 bengolder  staff   56 Apr 24 10:46 change-extension -> /Users/bengolder/dotfiles/zsh/functions/change-extension
-rw-r-----   1 bengolder  staff  528 Apr 24 10:47 change-extension.zwc
lrwxr-xr-x   1 bengolder  staff   45 Apr 24 10:46 envup -> /Users/bengolder/dotfiles/zsh/functions/envup
-rw-r-----   1 bengolder  staff  752 Apr 24 10:47 envup.zwc
lrwxr-xr-x   1 bengolder  staff   41 Apr 24 10:46 g -> /Users/bengolder/dotfiles/zsh/functions/g
-rw-r-----   1 bengolder  staff  512 Apr 24 10:47 g.zwc
lrwxr-xr-x   1 bengolder  staff   43 Apr 24 10:46 mcd -> /Users/bengolder/dotfiles/zsh/functions/mcd
-rw-r-----   1 bengolder  staff  424 Apr 24 10:47 mcd.zwc

System details:

  • MacOS 14.4.1
  • iTerm2 3.4.23
  • zsh 5.9 (arm-apple-darwin23.0.0), installed via homebrew

Any questions or debugging suggestions welcome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions