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

Re: zsh as ksh for login shell -- a bug with PS1?



"William H. Magill" wrote:
> I have a two-line prompt string
> 
> PS1='[$PWD] $me
>   $HOST> '
> 
> I have been using this for many years. It works fine under ksh on Tru64 
> Unix 5.1 and when zsh 4.2.1 itself is evoked as the login shell.
> 
> However, if I change the /etc/password entry to evoke ksh instead of 
> zsh, the newline is lost, resulting in a prompt consisting of "$HOST> "

I think you're saying that ksh is really a link to zsh.  In that case
zsh will start up with a different set of options.  Probably the
critical one in this case is single_line_zle.  Try "unsetopt
single_line_zle" and see if that works.  (If my experiment is correct
this is exactly the problem.)

The option isn't there for the prompt, in fact, it's there because ksh
doesn't handle multiple line editing buffers.  It so happens that in zsh
this is associated with a multi-line prompt.  However, it's not at all
clear we really need to enforce this restriction of ksh when emulating
it anyway.  It's hard to think of a case where it's an advantage.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



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