[Semibug] Crazy unix shell prompts
Nick Holland
nick at holland-consulting.net
Fri Jan 6 17:38:03 EST 2023
On 12/28/22 23:10, Nick Holland wrote:
> I tripped across an idea recently which I'm not sure if
> it is brilliant or evil. But I kinda like it.
...
> export PS1='\n'$(tput setf 7)#$(tput setf 0)'\$\$\$ \u @ \h \w \$\n'
> export PS2="$(tput setf 7)#$(tput setf 0)>\n"
I like the PS1. Wasn't really fond of PS2. I think I fixed
that...
export PS2=":\r"
Now, the continuation prompt is ':', BUT the cursor is moved back
to the beginning of the line so the next thing you type overwrites
it, removing it from any future copy/paste.
This eliminates the every-other-line-is-a-comment thing.
note: if you have a blank line in your pasting, you end up with
a : in your next copy/paste, which works a bit like a comment in
bash and ksh. But it might be unexpected. A '#' would work, but
that was too much like a usual shell prompt for my tastes.
Nick.
More information about the Semibug
mailing list