1 |
Maybe someone here has missed the recent discussion of zsh? ;) |
2 |
|
3 |
I just found this website, giving a wonderful primer on how to |
4 |
configure zsh: |
5 |
|
6 |
http://wiki.redbrick.dcu.ie/mw/Account_Customisation_(zsh) |
7 |
|
8 |
Disclaimer: I have no idea who they are, but I found this article very |
9 |
helpful indeed, and their advice Worked For Me. |
10 |
|
11 |
In particular, I wanted to set my zsh command prompt to look like the |
12 |
custom bash prompt I've been using forever: |
13 |
|
14 |
echo $PS1 |
15 |
\u@\h:\w |
16 |
|
17 |
Now here's the equivalent value in zsh: |
18 |
|
19 |
echo $PS1 |
20 |
%n@%M:%~ |
21 |
|
22 |
The most significant thing I just learned is that the zsh config name |
23 |
for its command prompt is PS1, the same as for bash. (I needed help |
24 |
from the above-named website to get the details, but that was easy.) |
25 |
|
26 |
I made the change to PS1 permanent by adding this familiar line to my |
27 |
~/.zshrc: |
28 |
|
29 |
export PS1="%n@%M:%~ " |
30 |
|
31 |
Here is one interesting feature of zsh: when I type e.g. 'les' and |
32 |
then hit Tab to invoke shell-completion, zsh shows me the usual |
33 |
suspects like less, lessecho, lesskey, etc. |
34 |
|
35 |
But then if I continue to hit Tab multiple times, zsh actually changes |
36 |
the command prompt, rotating the possible commands through all the |
37 |
possible choices, and then I can just hit Return to execute my choice. |
38 |
|
39 |
A minor feature, but clever, I think. |