Skip to content

Ability to use existing shell for commands and git actionsΒ #899

@lordlycastle

Description

@lordlycastle

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 by nvm 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 shell nvm 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 for fish 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 using lazygit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions