-
Notifications
You must be signed in to change notification settings - Fork 193
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
Running git funcitons in subshell breaks vared in zsh #321
Comments
so I have to downgrade? |
Confirmed rolling back to previous commit of 6c85b86 fixes the issue. Commit message of 136fb6b states
I do not have the issue. I am able to ctrl-c without my current shell session terminating. Can we get a rollback then a PR with the proposed changes as not to break environments by just pushing to main. |
Took me a while to find this. I reverted the offending commit locally. This should get fixed. Super annoying. |
I think this is the reason[1] this isn't working after the targeted commit. When these were changed to running in a subshell, the The reason for running these functions in a subshell seems legitimate, so I not sure how to handle the situation? Maybe removing the usage of Sorry for the annoyance [1] 136fb6b#diff-9070c9d1a356a6ef9eacfc3002d78d0d9b5b88ba9c8509884d66564f3a7aa3ccR220 |
I just ran into this too. So leaving a comment to bump this issue 🙂 |
cd ~/.scm_breeze |
Undoing the diff only for
|
Thanks @isDipesh! Yeah apparently it's the use of parenthesis instead of brackets in these functions ¯_(ツ)_/¯ diff --git a/lib/git/status_shortcuts.sh b/lib/git/status_shortcuts.sh
index 54b3191..a8616ce 100644
--- a/lib/git/status_shortcuts.sh
+++ b/lib/git/status_shortcuts.sh
@@ -209,7 +209,7 @@ theirs(){ _git_resolve_merge_conflict "their" "$@"; }
# * Execute prerequisite commands if message given, abort if not
# * Pipe commit message to 'git commit'
# * Add escaped commit command and unescaped message to bash history.
-git_commit_prompt() {
+git_commit_prompt() (
local commit_msg
local saved_commit_msg
if [ -f "/tmp/.git_commit_message~" ]; then
@@ -268,10 +268,10 @@ git_commit_prompt() {
# Delete saved commit message if commit was successful
rm -f "/tmp/.git_commit_message~"
fi
-}
+)
# Prompt for commit message, then commit all modified and untracked files.
-git_commit_all() {
+git_commit_all() (
fail_if_not_git_repo || return 1
changes=$(git status --porcelain | wc -l | tr -d ' ')
if [ "$changes" -gt 0 ]; then
@@ -283,10 +283,10 @@ git_commit_all() {
else
echo "# No changed files to commit."
fi
-}
+)
# Add paths or expanded args if any given, then commit all staged changes.
-git_add_and_commit() {
+git_add_and_commit() (
fail_if_not_git_repo || return 1
git_silent_add_shortcuts "$@"
changes=$(git diff --cached --numstat | wc -l)
@@ -296,4 +296,4 @@ git_add_and_commit() {
else
echo "# No staged changes to commit."
fi
-}
+) |
136fb6b breaks git_command_prompt in my zsh setup. Seems like vared is not working properly in subshell.
git_commit_prompt:vared:8: ZLE not enabled
The text was updated successfully, but these errors were encountered: