[Chapter 7] 7.10 What Good Is a Blank Shell Prompt?
Author: Jerry Peek, Tim O'Reilly & Mike Loukides
Date: 1998-08-04T21:33:55Z

#

| Chapter 7 Setting Your Shell Prompt |

## 7.10 What Good Is a Blank Shell Prompt?

[This tip is also great if you use a mouse to copy and paste command lines in your window.]

Some terminals I've used (like old Hewlett-Packard and Tektronix terminals) had local editing. You could move your cursor up the screen to a previous command line, maybe make some edits to it, then press a SEND LINE key to resend that line to the host. This didn't have anything to do with sophisticated command-line editing (11.13) like some UNIX shells have now. Maybe your terminal can do that, too.

The problem was that unless I erased the shell prompt (`%`) on my screen, it would be sent back to the shell and give the error "`%`: Command not found." So I set my shell prompt to this:

>     set prompt='     '

That's right: four spaces. Most UNIX commands start their output at column 1, so my command lines were easy to find because they were indented. And the shell didn't care if I sent four spaces before the command line. So everything was fine until I got my new terminal without a SEND LINE key...

(If you want some information in your prompt, too, make a multiline prompt (7.5) with four spaces in the last line.)

- JP

7.9 Show Subshell Level with $SHLVL |  | 7.11 dirs in Your Prompt: Better than $cwd