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

Re: !!$ unitialized at first prompt



It might be nice to introduce a new history format that would indicate the
word splitting in a simple manner.  One possibility is to output all spaces
inside a word as some other sequence of characters.  If the new encoding
were indicated in the prefixed extended-history header, the parsing code
would know if it should split the line based on the new, simple decoder or
the old-style parser.  One complicating factor is a syntax that splits into
separate words without intervening spaces.  To deal with that we'd either
need a character sequence to indicate this, or we'd need to still run the
line through the parser before decoding the words.

Here's one possible encoding would use URI encoding to fully encode all the
history semantics of the line.  I'm indicating its presence with a ":%" in
the prefix, like this:

: 1226351062:0:%;cat file%20name%20with%20spaces%20(100%25)
>%00/tmp/file%20name

In the above, I indicated a word-split that didn't have a space with a null
(%00), so the above is 4 words.  The idea is to come up with an encoding
that directly translates between the internal representation and a hist-text
representation.  Would we need more encoding rules?  Maybe something for
metafied chars?

..wayne..


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