Re: Prompt Insanity - 2007-03-14 01:42:51
I guess I'm the only person left who still uses: PS1=':; '
Automatic ls is something I'm slowly getting back into - I got out of that habit when I was doing lots of fiddling with the MoD stuff at basser. Automatic ls in one of those directories would prompt a five minute wait for the listing to finish or for your ctrl-C to get recognised as you process was stuck in NFS hell.
I still work with a bunch of directories where the following holds true:
:; rm * -bash: /bin/rm: Argument list too long :;
Which tends to keep me out of that habit - no NFS involved though which makes the ctrl-C a bit quicker but a remote server rather than on the same ethernet network which makes the ctrl-C still not instant. I do it on my home machines a bit, I think it's a reaction to doing somethingin the wrong directory at some point - the ls gives you a chance to notice.
I also use PROMPT_COMMAND to set the titlebar text of my xterm/putty window to user@host:dir. Not having that in PS1 is mana from heaven - especially when you run a different shell flavour for a minute.
Update:
If yvan would just add comments I could put all this stuff there and keep my cricket reports on top here...
Anyway, ">" would be annoying as a prompt to me, since it's a special character to the shell and would mean you'd have to be very precise in copying and pasting between terminal windows. This is by the way the reason for using ":; " (I used to use "; " because I used to use a less retarded shell which accepted empty commands, but bash is not such a shell - a bunch of places still have "; " though I used it when I first wrote this message yet another old habit) it has the useful property that you can copy the entire line and paste it in another terminal window and it will just work. I'm lazy enough to prefer triple clicking to dragging out a selection.
And yes .bashrc wouldn't be loaded by other shells, the problem is I occasionally just run another shell as a command, in which case it inherits those settings. A smart person would just not export PS1 I guess... But I'm not that smart person and I was foolish last time I played with .bash* files.