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

Error when entering or leaving a project with .env or .env.leave file #239

Open
alexlyttle opened this issue Jul 11, 2024 · 3 comments
Open
Labels

Comments

@alexlyttle
Copy link

Platform

  • Operating system and version? macOS Sonoma 14.5 arm64
  • Shell and version? zsh 5.9
  • autoenv installation method: homebrew
  • autoenv version: 0.3.0

Describe the bug

When I change to a directory with a .env file it executes the file followed by this error:

(eval):1: bad pattern: ^[[01

I have tried this on the simplest of .env file, e.g.

echo "Hello"

and still get the error. The output when changing the directory is:

Hello
(eval):1: bad pattern: ^[[01

The .env file appears to execute fully, I am just not sure where the error comes from.

Expected behavior

In the above example, expected output would be,

Hello

Additional context

I have export AUTOENV_ENABLE_LEAVE=1 in my .zprofile.

I have tried uninstalling and reinstalling autoenv.

@hyperupcall
Copy link
Owner

Unfortunately, I'm not able to reproduce this issue. Could you run:

$ setopt
autocd
autocontinue
...

So I can see the shell options that you have enabled? I think they could be affecting execution.

@alexlyttle
Copy link
Author

Here are the results of that command:

aliasfuncdef
allexport
combiningchars
interactive
login
monitor
promptsubst
shinstdin
zle

@hyperupcall
Copy link
Owner

hyperupcall commented Oct 5, 2024

Thanks for the info! Unfortunately, I have not been able to reproduce the issues with those shell options options and with zsh 5.9 on Linux. I used the following env file to test (i assume yours has the same exact contents):

$ hexdump -C .env
00000000  65 63 68 6f 20 22 48 65  6c 6c 6f 22 0a           |echo "Hello".|
0000000d

When I get access to a Macintosh, I'll try it on there

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

No branches or pull requests

2 participants