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

Re: %l prompt expansion change



On Jun 19, 10:34pm, Andrej Borsenkow wrote:
} Subject: Re: %l prompt expansion change
}
} On Tue, 19 Jun 2001, Clint Adams wrote:
} 
} > > PS1='<%?>%n@%m[%l]:%~%# '
} > > <0>tretkowski@infinity[tty9]:~%
} > >                        ^^^
} > > When I use a zsh binary from potato, %l is handled correct:
} > >
} > > <0>tretkowski@infinity[tty9]:~% ./zsh    <-- potato binary
} > > <0>tretkowski@infinity[9]:~%
} >
} > Can you explain what makes this incorrect rather than aesthetic?
} 
} Well, mostly aesthetic considerations. It is `0' om /dev/tty0 and pts/3 or
} term/4 somewhere else. Also, ps usually shows tty line as base name sans
} /dev/. And not every Unix is Linux yet to treat /dev/tty* specially.

The treatment of /dev/tty* has nothing to do with Linux, and everything
to do with old BSD around 4.2, where real TTYs were named /dev/ttyt* and
PTYs were named /dev/ttyp*, and the intent was to have %l expand to e.g.
"t9" or "p9".  The idea of logging in on a real system console with a
/dev/tty<-> name probably never occurred to PF -- unix machines were
almost exclusively time-sharing when this code was first written.

I can almost guarantee that PF never expected %l to expand to include an
entire directory name like "pts/" or "term/".  Prompts are intended to be
extremely concise, to maximize editing space.  That's why RPROMPT came to
exist: a prompt that could be verbose but would get out of the way when
your command line got long.
 
} I asked if somebody was against this change.

Well, we asked if anybody was against the HIST_NO_STORE change, too, and
now Vincent is complaining about it.  Probably we should ask these kinds
of questions on zsh-users (without including the proposed patch).

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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