autoenv icon indicating copy to clipboard operation
autoenv copied to clipboard

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

Open alexlyttle opened this issue 1 year ago • 3 comments
trafficstars

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.

alexlyttle avatar Jul 11 '24 10:07 alexlyttle

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.

hyperupcall avatar Sep 30 '24 00:09 hyperupcall

Here are the results of that command:

aliasfuncdef
allexport
combiningchars
interactive
login
monitor
promptsubst
shinstdin
zle

alexlyttle avatar Oct 01 '24 10:10 alexlyttle

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

hyperupcall avatar Oct 05 '24 11:10 hyperupcall