From e6f4cd8694781d5afd8d10e8bd74e58192cc59ac Mon Sep 17 00:00:00 2001 From: anonfunc Date: Mon, 27 Aug 2012 16:49:39 -0700 Subject: [PATCH] Use vared in zsh instead of read. This change seems to do what you want. It passes ! and \ untouched, it gets history from the shell and it uses the zsh line editor for arrow keys and home/end. --- lib/git/status_shortcuts.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/git/status_shortcuts.sh b/lib/git/status_shortcuts.sh index 0471c60..63dbda4 100644 --- a/lib/git/status_shortcuts.sh +++ b/lib/git/status_shortcuts.sh @@ -175,9 +175,7 @@ theirs(){ _git_resolve_merge_conflict "their" "$@"; } git_commit_prompt() { local commit_msg if [[ $shell == "zsh" ]]; then - # zsh 'read' is weak. If you know how to make this better, please send a pull request. - # (Bash 'read' supports prompt, arrow keys, home/end, up through bash history, etc.) - echo -n "Commit Message: "; read commit_msg + vared -h -p "Commit Message: " commit_msg else read -r -e -p "Commit Message: " commit_msg fi