The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
Changing your tcsh prompt 14 January 2000
Need more help on this topic? Click here
This article has 1 comment
Show me similar articles
see also Shells

The research for this article was done by Hydro- and huey_ on Undernet's #FreeBSD IRC channel.

man tcsh
Hydro- told me where to look.  If you want the prompt set each time you login, put the code in either .tcshrc or .login in your home directory.   But my opinion is that you should use the shell-specific file for shell-specific things.  In other words, I recommend .tcsh over .login.
.login
First, go to your home directory:

If you want a prompt that looks like:

[user@host] current/path(cmnd#)

Then use:

set prompt="%B[%n@%m]%b%/(%h): "
Changing your tcsh prompt 20 May 2000
Andrew Zavjalov writes in with this stuff about prompts:
  1. A nice prompt in xterm only! (or in smart ssh client, f.e. TeraTermPro):

    set ellipsis set prompt='%{^[]0;%n@%m, %.03, %P, CODE=%?^G%}%B%n%b@%m%B:%b%.02> '

    ^[ - Esc ^G - \007

    This prompt will change xterm title every time.

    Another prompt (huge and not useful): #set prompt='%{^[]0;%n@%m, %.03, %P, CODE=%?^G%}%{'"`echotc AF 2`"'%}%B%n%b%{'"`echotc AF 1`"'%}@%{'"`echotc AF 3`"'%}%m%B%{'"`echotc AF 5`"'%}:%{'"`echotc AF 7`"'%}%b%.02> '
  2. timing... set time=(1 '%Uu %Ss %E %P %X+%Dk (max %Mk) %I+%Oio %Fpf(%Rmpf)+%Ww %rr+%ss SIG: %k %w+%c')

    Then try to execute long process (longer then 1 second and not `sleep 2` :-).
  3. set savehist=(1000 merge)

    merge!

  4. report about logging on/logging off other people...
    set log set watch=(1 any any) set who="%n@%M (%a)"
  5. TAB-complete... more useful: bindkey ^I complete-word-fwd
  6. And about ls (don't forget about "set term=xterm-color" if you use teraterm, scrt etc.):

    alias ll colorls -lAFG alias l colorls -aFG setenv LSCOLORS "3x5x2x3x1x464301060203"

    (colorls in ports/packages)

    I use only colorls in shell.


Need more help on this topic? Click here
This article has 1 comment
Show me similar articles