Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
vared in scripts and history
- X-seq: zsh-users 8503
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Zsh users list <zsh-users@xxxxxxxxxx>
- Subject: vared in scripts and history
- Date: Tue, 15 Feb 2005 13:19:35 +0000
- Mail-followup-to: Zsh users list <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hi list,
I've got a question. I'd like to add a vared like line editor to some
interactive command. I've noted the "nslookup" user function approach,
but I was thinking of another way to do it, that would be more flexible:
use GNU screens :exec functionality.
Basically, if (within screen) I run:
screen -X exec '.!.' ./zf $TTY; tr a-z A-Z
Where zf is:
#! /usr/bin/env zsh
trap 'printf "\03"; exit' INT
while a=; vared -p "$2" -e a; do
{
s=$(stty -g)
stty -echo
printf "%s\r" "$a"
stty "$s"
} < $1
done
printf "\04"
I get the terminal builtin line editor replaced with zsh's line editor
for tr.
Which is already great.
Now, I'd like to add some history support. But I couldn't have it to
work. Is there any way?
TIA
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author