Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
EOF in read-from-minibuffer causes delayed exit
- X-seq: zsh-workers 20977
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: EOF in read-from-minibuffer causes delayed exit
- Date: Tue, 15 Mar 2005 04:34:12 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Start a shell you don't mind exiting from. Cut'n'paste the following:
autoload -U read-from-minibuffer
insert-file() {
local REPLY
while [[ ! -r $REPLY ]]
do
read-from-minibuffer 'Insert file: ' $REPLY || return 1
[[ -r $REPLY ]] || zle beep
done
if zmodload -i zsh/mapfile
then RBUFFER="$mapfile[$REPLY]$RBUFFER"
else RBUFFER="$(<$REPLY)$RBUFFER"
fi
}
zle -N insert-file
Invoke this with ESC-x insert-file RET.
Now type ctrl-D. Note feep. Type ctrl-G. Shell exits.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author