←back to thread

217 points tanelpoder | 1 comments | | HN request time: 0.001s | source
Show context
enriquto ◴[] No.26493019[source]
The classic copy-pasteable prompt (for true graybeards) is simply

        PS1='; '
If you want some more information, the trick is this:

        PS1=': stuff ; '
where "stuff" is whatever string you want to show (without redirection characters). This works because the colon is the "true" executable that ignores all its arguments, and the semicolon introduces your command that can thus be pasted along the whole line.
replies(3): >>26493124 #>>26493993 #>>26496935 #
1. atrn ◴[] No.26496935[source]
No beard but it would be grey...

A variant of this has been my PS1 since the 90s (yes, mostly on workstations with a GUI by then [Sun,NeXT,HPUX etc...]). Unfortunately bash doesn't like a lone ';' without something before it ("-bash: syntax error near unexpected token `;'") so I've had to use ':; ' with it (I like its use of readline, emacs user since Gosling's in the early 80s).

Triple-click, middle-click (for xterm and others that do that) is efficient and easy. The csh-inspired '!!' can work nicely too though.