Describe the bug
If one of the directory names in a path to the .envrc starts with certain characters (eg. b) then direnv mangles the path while searching for the .envrc
To Reproduce
-
Install Git For Windows 2.38.1
-
Run git-bash shell
-
Instal direnv hook: eval "$(direnv hook bash)"
-
Create a dir directory and dir/.envrc file then navigate to dir
mkdir dir && cd dir && touch .envrc
In this case, everything works as expected, .envrc is loaded 👌
direnv: loading /d/dir/.envrc
- Still being in
dir directory create a bug directory and bug/.envrc file then navigate to bug
mkdir bug && cd bug && touch .envrc
In this case, direnv mangles the path and fails 💥
direnv: referenced /d/diug/.envrc does not exist
direnv: error exit status 1
Expected behavior
Mind the broken .envrc load path /d/diug/.envrc. It should be /d/dir/bug/.envrc. It seems the .../b... character was interpreted as a backspace escape sequence.
Environment
- OS:
MSYS_NT-10.0-19044
- Shell:
git-bash
- Direnv version:
2.32.2
Additional context
It seems the bug is a regression introduced in the 2.32.2 release. It does not occur in a previous 2.32.1 version.
Describe the bug
If one of the directory names in a path to the
.envrcstarts with certain characters (eg.b) thendirenvmangles the path while searching for the.envrcTo Reproduce
Install Git For Windows
2.38.1Run
git-bashshellInstal
direnvhook:eval "$(direnv hook bash)"Create a
dirdirectory anddir/.envrcfile then navigate todirIn this case, everything works as expected,
.envrcis loaded 👌dirdirectory create abugdirectory andbug/.envrcfile then navigate tobugIn this case,
direnvmangles the path and fails 💥Expected behavior
Mind the broken
.envrcload path/d/diug/.envrc. It should be/d/dir/bug/.envrc. It seems the.../b...character was interpreted as abackspaceescape sequence.Environment
MSYS_NT-10.0-19044git-bash2.32.2Additional context
It seems the bug is a regression introduced in the
2.32.2release. It does not occur in a previous2.32.1version.