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.
This commit is contained in:
@@ -175,9 +175,7 @@ theirs(){ _git_resolve_merge_conflict "their" "$@"; }
|
|||||||
git_commit_prompt() {
|
git_commit_prompt() {
|
||||||
local commit_msg
|
local commit_msg
|
||||||
if [[ $shell == "zsh" ]]; then
|
if [[ $shell == "zsh" ]]; then
|
||||||
# zsh 'read' is weak. If you know how to make this better, please send a pull request.
|
vared -h -p "Commit Message: " commit_msg
|
||||||
# (Bash 'read' supports prompt, arrow keys, home/end, up through bash history, etc.)
|
|
||||||
echo -n "Commit Message: "; read commit_msg
|
|
||||||
else
|
else
|
||||||
read -r -e -p "Commit Message: " commit_msg
|
read -r -e -p "Commit Message: " commit_msg
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user