Zsh Mailing List Archive
Messages sorted by:
Re: multiline ZLE w/ bash-like single line .zsh_history...?
- X-seq: zsh-users 15647
- From: zsh@xxxxxxxx
- To: zsh-users@xxxxxxx
- Subject: Re: multiline ZLE w/ bash-like single line .zsh_history...?
- Date: Thu, 9 Dec 2010 11:12:56 -0800 (PST)
- In-reply-to: <101207203433.ZM4335@xxxxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Thanks for showing me the "zsh way" (very cool!)...
You are right about the "here document" issue. When I enter a
command that has one, like so:
... and then inspect my .zsh_history file, I see:
This is not consistent with what the perl version currently looks for.
It thinks a single terminating slash should become ';' in the new
single line version of the command it wants to generate. For the perl
zsh_cook_history implementation to work, there needs to be special
'<<' handling that triggers an exception to the normal handling of the
terminating '\'. Without that extra logic, it results in this single
line as output (which is wrong):
But maybe the zsh version of zsh_cook_history could be made to handle
it properly with a tweak to (z), as you alluded to previously... At
the moment, it's results are similarly not correct:
cat << EOF ; one ; two ; EOF
Because I think the zsh way is better than the perl way, and because
this issue does not really affect my intended use of zsh_cook_history,
I will not bother fixing my perl version but rather just use the zsh
version and be happy. Should (z) get updated in the future, then
that's a bonus!
As for INTERACTIVE_COMMENTS, I do have that option set, but I'm not
sure how to enter a multiline interactive comment, so unless there is
a method I'm unaware of to do that, it's a non-issue (single line
interactive comments seem OK in both zsh_cook_history implementations).
This will not work as the first line in a multiline w/ interactive
echo # comment \
For me, the '#' char effectively turns off the '\' char...
I'm very pleased with my new zsh_cook_history function (that you
provided) and I thank you for your help and expertise!
Messages sorted by: