2024-02-12 07:10:20 +00:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
|
|
|
zle-line-init() {
|
|
|
|
emulate -L zsh
|
|
|
|
|
|
|
|
[[ $CONTEXT == start ]] || return 0
|
|
|
|
|
|
|
|
while true; do
|
|
|
|
zle .recursive-edit
|
|
|
|
local -i ret=$?
|
|
|
|
[[ $ret == 0 && $KEYS == $'\4' ]] || break
|
|
|
|
[[ -o ignore_eof ]] || exit 0
|
|
|
|
done
|
|
|
|
|
|
|
|
local saved_prompt=$PROMPT
|
|
|
|
local saved_rprompt=$RPROMPT
|
2024-04-02 17:32:56 +01:00
|
|
|
PROMPT=' '
|
2024-02-12 07:10:20 +00:00
|
|
|
RPROMPT=''
|
|
|
|
zle .reset-prompt
|
|
|
|
PROMPT=$saved_prompt
|
|
|
|
RPROMPT=$saved_rprompt
|
|
|
|
|
|
|
|
if ((ret)); then
|
|
|
|
zle .send-break
|
|
|
|
else
|
|
|
|
zle .accept-line
|
|
|
|
fi
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
zle -N zle-line-init
|