Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: append to history entry?
On 28/12/16 11:20 AM, Ray Andrews wrote:
Ok, I'll see what I can figure out.
Needless to say this is exploratory:
function zshaddhistory ()
{
LITERAL=( "${(@s/;/)1}" )
#print -rl $LITERAL
LITERAL[1]=${LITERAL[1]/ #/}
LITERAL[2]=${LITERAL[2]/ #/}
LITERAL[3]=${LITERAL[3]/ #/}
LITERAL[4]=${LITERAL[4]/ #/}
LITERAL[5]=${LITERAL[5]/ #/}
#print -r $LITERAL[1]
#print -r $LITERAL[2]
#print -r $LITERAL[3]
#print -r $LITERAL[4]
#print -r $LITERAL[5]
}
function test ()
{
print -r "you typed: $LITERAL[1]"
}
$ test \r * \n""''
you typed: test \r * \n""''
$ test $HOST
you typed: test $HOST
... but it seems to do exactly what I want the only thing lacking is to
associate each
member of the array to the appropriate command, if there are several on
the same line.
I can think of a few hacks that might do it, but is there a robust way?
Would precmd()
be able to keep count? Something of that nature? This is going to come
out right.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author