== The _:;_ shell prompt trick For years, I've had a somewhat unusual shell prompt. It looks like this: > _: ~~~~ ;_ (where _~~~~_ is the hostname of the current machine.) Putting the hostname in your prompt is pretty ordinary, but what's the other stuff? These days, a more typical shell prompt is something like '_cks@newman:~$ _', to quote a Debian example. (And many people use more elaborate prompts, such as [[Jamie Zawinksi's http://jwz.livejournal.com/603454.html]].) The trick here is that the _:_ and _;_ turn my prompt into a valid shell command that does nothing. This makes cutting and pasting previous commands in things like _xterm_ much easier, since I don't have to carefully get just the command while avoiding the prompt. (In _xterm_ it's just a quick triple click, but then _xterm_ is very good at this.) (In practice I am sufficiently neurotically neat that I select just the command, because seeing a doubled prompt looks wrong. This might be different if my prompt was just '_:; _', but I need the host name in it to keep things straight.) This trick is not original to me; I believe I got it from observing [[Geoff Collyer http://www.collyer.net/who/geoff/]], many years ago. === Sidebar: _xterm_'s double-click selections One reason I don't use this more is that _xterm_'s double-click selection mode makes selecting most things pretty fast anyways. For those who aren't aware of it, when you start a selection by double-clicking instead of single-clicking, _xterm_ grows the selection by words instead of characters. (Try it; it's more intuitive than I make it sound.) Embarrassingly, I spent years using _xterm_ before I found out about this. Now I use it all the time, and hardly ever have to select by characters.