-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Ability to use existing shell for commands and git actions #899
Comments
I briefly looked into this a while back but couldn't find a way to carry over the state of the shell environment into the program. I think it's a security thing, though my memory is hazy on it. Perhaps there's a way to initialize a new shell from within lazygit, however that wouldn't be able to carry over variables defined on the outside |
I think we can get halfway there by letting the user specify which shell to use. It means you won't have access to local variables but you'll get access to your rc file for example (I think) |
I wonder if that'll work with It is the hooks that need the custom environment. We chose not to include
What about Is there an argument to run the custom commands in the same env as well? It would create consistent experience and would remove the need for the feature mentioned above. |
Wanting this too, |
I recently ran into that issue so don't mind me just bumping for visibility. Looks like there is a promising PR on the horizon #3299 |
Is your feature request related to a problem? Please describe.
If you have a git hook before push/commit and it depends on a certain tool e.g. node then it is best to use the current shell.
For example I have
nvm
and various node versions. In the git hook it runs tests using node and it expects a certain version. I load the correct version bynvm use v8
but lazygit still complains about wrong version and stops all the commits and pushes. That is because I image it is running in a separate shell like when you run custom commands, and in that shellnvm
never switched to required version.This is the same issue when you run custom commands, it runs
bash -c ...
. Firstly now you need to format your commands for bash instead of default shell/current shell which is very annoying (especially forfish
users where syntax is different). And you cannot use local variables, and some time even all commands as you might not have updated.bashrc
to include all paths that are there in your current/default shell; since you never use it.Describe the solution you'd like
Run all custom commands and git commands in current shell process.
Describe alternatives you've considered
Alternative is using
git
directly from current shell and not usinglazygit
.The text was updated successfully, but these errors were encountered: