496
edits
mNo edit summary |
mNo edit summary |
||
| Line 9: | Line 9: | ||
[zsh prompt]> [right side prompt] | [zsh prompt]> [right side prompt] | ||
All we have done here is exported the two variables for the left side of the command prompt (PS1) and the right side of the command prompt (RPS1). You can add these two commands to your .zshrc so that your command prompts will be set like so | All we have done here is exported the two variables for the left side of the command prompt (PS1) and the right side of the command prompt (RPS1). You can add these two commands to your .zshrc so that your command prompts will be set like so every time you log in. Just place these lines in your .zshrc: | ||
export PS1="Your Left Side Command Prompt ==>" | export PS1="Your Left Side Command Prompt ==>" | ||
export RPS1="Your Right Side Command Prompt ==>" | |||
and then source your .zshrc by typing: | and then source your .zshrc by typing: | ||
| Line 45: | Line 45: | ||
Your current tty e.g. pts/100 | Your current tty e.g. pts/100 | ||
Including these in your command prompt exports allows you to have a clock on your command prompt which updates | Including these in your command prompt exports allows you to have a clock on your command prompt which updates every time you press return, and you can see your current working directory to save you typing "pwd" every time you forget where you are. e.g. | ||
cambo@prodigy (~) % export PS1="[%B%n%b @ %M]>" | cambo@prodigy (~) % export PS1="[%B%n%b @ %M]>" | ||
| Line 53: | Line 53: | ||
== Adding colours to the command prompt == | == Adding colours to the command prompt == | ||
Its still looking kinda plain isn't it | Its still looking kinda plain isn't it? Maybe we could add some colours to it to see what we can do. zsh has another special set of escape characters specifically for printing colours at the prompt and we can also add these sequences to our PS1/RPS1 variables. | ||
At this point it gets a little more complicated. But with a little perseverance you can have your own | At this point it gets a little more complicated. But with a little perseverance you can have your own customised and coloured account. The following are the escape sequences for creating the coloured text. | ||
%{\e[1;31m%} | %{\e[1;31m%} | ||
| Line 126: | Line 126: | ||
So say | So say I'm the only person in your .friends file whose username begins with "c". Typing "ps -fU c<-TAB->" will auto-complete to "ps -fU cambo" (NB* this will also work for an alias of that command if you have one set). This can be convenient if you have a list of commands that you use on a regular basis for which aliases would be unsuitable. | ||
zsh message (exporting ARGV0) | zsh message (exporting ARGV0) | ||
You may have seen when you "spy" on another user's processes that they have a | You may have seen when you "spy" on another user's processes that they have a customised zsh message in the process list. More and more people do this as an added customisation (and annoyance ;)) to their account. | ||
(~)[cambo@prodigy]>> ps -fU cambo | (~)[cambo@prodigy]>> ps -fU cambo | ||
edits