Node:Prompt codes, Next:Transfer codes, Previous:Keywords, Up:Configuration
Prompt codes
These codes can be used in the prompts, Keywords, to reflect dynamic information. For all codes, there may be an optional minimum field width. This is an integer between the '%' and the code character.
%u
- username
%h
- remote host name (as passed to open)
%H
- %h up to the first '.'
%m
- remote machine name (as returned by gethostbyname)
%M
- %m up to the first '.'
%n
- remote IP number
%w
- current remote working directory
%W
- basename of %w
%~
- as %w but home directory is replaced with ~
%l
- current local working directory
%L
- basename of %l
%c
- Total number of connections open
%C
- The number of the currently active connection
%%
- a percent sign
%#
- a '#' if (local) user is root, else '$'
%{
- begin sequence of non-printing chars, ie escape codes
%}
- end sequence of non-printing chars, ie escape codes
\e
- an escape character (hex 0x1B)
\n
- a newline
\t
- a tab character
\r
- a carriage return
\x##
- character 0x## (hex)
Example:
prompt3 "(%C) %{\e[1%}myafc%{\e[0m%} %u@%h:%42~> "