jesseduffield / jesseduffield/lazygit

`LAZYGIT_NEW_DIR_FILE` error in wsl

Open
#2,286 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Describe the bug**
When I added the scripts of `Changing Directory On Exit` on WSL's bashrc, it will cause me to fail to start lazygit.
![image](https://user-images.githubusercontent.com/54882546/203452503-5962b200-ff61-4223-9e2f-2d7ad05e88ea.png)

**To Reproduce**
Steps to reproduce the behavior:

1. Add it to `bashrc`, save and quit:
```
lg()
{
export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir

lazygit "$@"

if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null
fi
}
```
2. Open a new terminal, and try to start lazygit in a git project directory, then will kill the wsl process
![image](https://user-images.githubusercontent.com/54882546/203453136-f9119c1e-de3e-4bfb-b56a-31dd906a0018.png)

**Expected behavior**
it should work fine.

**Screenshots**
Above.

**Version info:**
_commit=924a152ae92372a178bd0fc32b411612b995a6a1, build date=2022-11-15T05:00:46Z, build source=unknown, version=924a152a, os=linux, arch=amd64, git version=2.25.1_

_git version 2.25.1_

**Additional context**
Add any other context about the problem here.

**Note:** please try updating to the latest version or [manually building](https://github.com/jesseduffield/lazygit/#manual) the latest `master` to see if the issue still occurs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.