Jump to content

Account Customisation (zsh): Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 21: Line 21:


zsh has some system escape sequences which can be used in your command prompt also. These sequences are special characters which relate to system properties. They can be included in your command prompts to make your prompt more dynamic. Some of the common escape sequences are:
zsh has some system escape sequences which can be used in your command prompt also. These sequences are special characters which relate to system properties. They can be included in your command prompts to make your prompt more dynamic. Some of the common escape sequences are:


{| border="1" cellpadding="2"
{| border="1" cellpadding="2"
Line 48: Line 49:
|Your current tty e.g. pts/100 || %l
|Your current tty e.g. pts/100 || %l
|}
|}


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.
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.
Line 60: Line 62:


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.
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.


{| border="1" cellpadding="2"
{| border="1" cellpadding="2"
Line 87: Line 90:
|Back to normal || %{\e[0m%}
|Back to normal || %{\e[0m%}
|}
|}


Here's the tricky part. These colour escapes sequences have to be printed to the prompt within the export command.  
Here's the tricky part. These colour escapes sequences have to be printed to the prompt within the export command.  
496

edits