-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support fish when running shell command #4350
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
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more Footnotes
|
This should allow using custom shell functions in lazygit's : prompt.
67ec969
to
f28b6f4
Compare
- **PR Description** In version 0.45.0 we started to use an interactive shell for running shell commands (see #4159). The idea was that this allows users to use their aliases and shell functions in lazygit without having to do any additional configuration. Unfortunately, this hasn't worked out well. For some users this resulted in lazygit hanging in the background upon trying to return from the shell command; we tried various fixes for this (see #4126, #4159, and #4350), but some users still have this problem (e.g. #4320). Also, starting an interactive shell can be a lot slower than starting a non-interactive one, depending on how much happens in the `.bashrc` or `.zshrc` file. For example, on my machine calling `zsh -ic true` takes 600ms, whereas `zsh -c true` takes less than 2ms. This is too high of a price to pay for using shell aliases, especially when _all_ users have to pay it, even those who don't care about using their aliases in lazygit. This PR reverts all commits related to interactive shells, and instead introduces a different approach: we let users specify a shell aliases file that will be sourced before running a command. The downside is that it doesn't work transparently out of the box, but requires configuration, and it may also require that users restructure their shell startup file(s) if they currently only have a single big one. The advantage is that only users who actually want to use aliases or functions are affected, and that we can now use this mechanism not only for shell commands, but also for custom commands and for calling the editor (some users have asked for this in the past).
This should allow using custom shell functions in lazygit's : prompt.
Fixes #4342.