Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: array with newlines preserved as literal text



On 2021-02-03 1:19 p.m., Bart Schaefer wrote:

 print -rv REPLY ...
or whatever other variable you want (it will be a string, not an array).

The phrase "its tail" still leaves me slightly doubtful.

Isn't 'tail' the normal term for whatever follows a command? I learned it as 'command tail' back in the day.

Anyway, more fiddling: I added " print -lr $@ " to my 'preexec()' and, mirabile dictu, it seems to capture input exactly as typed:

3 /aWorking/Zsh/Source/Wk 3 $ g '*$1*'
g '*$1*'
noglob _g '*$1*'  # 'g' is the alias that calls '_g' so that's understandable.
noglob _g '*$1*'  # Why the duplication?

... various tests show nothing expanded.  One thing tho, why the duplicate line?  In one case:

3 /aWorking/Zsh/Source/Wk 3 $ s g tiny bug 'grep -' line 88
s g tiny bug 'grep -' line 88
s g tiny bug 'grep -' line 88
s g tiny bug 'grep -' line 88

... three times?   And 's' is not an alias, that function goes straight in.  But here is my capture point for the literal command as it is typed, it seems.  "print ,lrv LAST_COMMAND $1  " and I'm good, the first line seems always correct.







Messages sorted by: Reverse Date, Date, Thread, Author