jesseduffield / jesseduffield/lazygit

Should automatic directory changes impact `LAZYGIT_NEW_DIR_FILE`?

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

Description

### Topic
When opening lazygit in a subdirectory of a git repo, it *automatically* `cd`'s up to the repo root to show a clearer file tree view from the root of the repo. However, this *automatic* `cd` does not play well with shell integration (using `LAZYGIT_NEW_DIR_FILE`) which tells that the current directory has been changed and thus `cd`'s the current shell session to root of the repository.

### Your thoughts
This could be worked around by using a more elaborate wrapper than the one currently suggested in the README, but I think, it would be more valuable to not have these kind of *automatic* `cd`s behave the same way as *user-input* `cd`s with regards to `LAZYGIT_NEW_DIR_FILE`.
Of course another alternative is for the user to use the `quitWithoutChangingDirectory` bind (`Q` by default) each time they know they haven't changed directory, but I think this should not be up to the user to handle.

Apart from this quirk, I do believe this is a nice feature, I was just very surprised when I found myself magically `cd`'d to the root of my repository soon after starting to use the wrapper suggested in the readme.

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.