[COFF] What is your prompt?

Steffen Nurpmeso steffen at sdaoden.eu
Sun Dec 26 05:14:37 AEST 2021


Grant Taylor wrote in
 <517271a2-c18c-f6b2-e5a8-0f93b2accba7 at spamtrap.tnetconsulting.net>:
 |On 12/25/21 10:39 AM, Steffen Nurpmeso wrote:
 |> I might be the only living one who has the expansion of $? in $PS1.
 |
 |It's not $PS1, but I do have $? in my Zsh $RPROMPT.
 |
 |I used to have $? in $PS1 before switching to $RPROMPT.
 |
 |> (And who's "~/.shrc" gives a _somewhat_ portable PS1 with
 |> last-component-of HOSTNAME and PWD.)
 |
 |I'd like to know more.
 |
 |I don't know if it's a good thing or not, but portability across 
 |platforms (OSs / architectures) is much less of an issue for me than it 
 |was in my last job.  Now I mostly worry about Linux and FreeBSD. 
 |Admittedly, some really old versions.

Sure.  Oh the compatibility of shells i meant, of course.  But
that mostly colours, now that ~/.profile ensures HOSTNAME and
LOGNAME per se.  No more \XY escapes here, except \e and the
\[..\] that some need (to get it column counting right, with
colours) (SHTYPE=bash and =yash).

And the "set -o" you need/can to get where you want to be, ksh for
example braceexpand, emacs-usemeta (if possible), expand_aliases
(bash), cdprint/emacs/tabcomplete (NetBSD ksh).

It is of course all a bitrot-affine compatibility mess.  You look
for $0, sometimes deeper for some *_VERSION, for $OSTYPE (which my
~/.profile sets, too).  But in the end it is all a mess.  If
i recall correctly i once proposed a standardized VERSION or xy
thing so that one could easily identify, even in subshells.  But
that would affect future shells only, anyhow.  At one time i have
thrown away a lot of tests, since fish and some other shells
i will never use no more, what remains is just enough to start
working the best i can with dash, bash, ksh.  Last change on PS1
in March 2018, i usually only have one account per $HOSTNAME.
Pretty bitter is shells without aliases, where the a-lia-ses have
to be created as sh_ell_functions.  And then one says builtin, the
other says built-in.

Yeah i mean computing would be nice, if there would not be those
uncountable quirks you need in real life.  The maintainer of
libinput has written a short down-to-earth article on that a few
years ago.

That reminds me of my bitter gut feeling that something bad will
happen, all these days, but luckily the rocket that carried some
real penis lifted successfully.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


More information about the COFF mailing list