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

Re: multiline ZLE w/ bash-like single line .zsh_history...?





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:

  cat <<EOF
  one
  two
  EOF

... and then inspect my .zsh_history file, I see:

  cat <<EOF\
  one\
  two\
  EOF

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):

  cat <<EOF;one;two;EOF

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
comments:

  echo # comment \

For me, the '#' char effectively turns off the '\' char...

- Tor

PS -

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: Reverse Date, Date, Thread, Author