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

Re: Comments in ZLE

On Feb 14, 11:02am, Frank Terbeck wrote:
} Subject: Re: Comments in ZLE
} kba <unixprog@xxxxxxxxxxxxxx>:
} > Is there a specific reason why this
} > is off by default? To avoid clashes with commands that start with '#'?
} Well, I'd guess it's been done to let people use the hash char without
} needing to quote it.

Zsh was originally invented with the intention of providing a csh-like
interactive experience for a Bourne-like shell language.  (Among other
reasons.)  Csh doesn't do comments at the interactive prompt, so zsh
didn't either.  Remember, we're talking nigh on to 20 years ago; no
Linux, and most universities had timeshared machines running 4.x BSD,
so the default shell for new users was csh (not even tcsh, which is
what most people mean now when they say csh).
} > Can '#' be used to do history expansion like '!' or something like this?
} Not that I would know, why?

Look at the HISTCHARS variable (and note that it can also be called
histchars, because of course csh uses the all-lower-case format).

In fact the answer to "Why does zsh do this weird thing that no other
shell I ever used does?" is frequently "You're too young to know what it
was like when nearly everybody's first shell exposure was csh."

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