Created
March 27, 2015 23:05
-
-
Save gdamore/20c2aae88d65a8e398bb to your computer and use it in GitHub Desktop.
This is a handy .login for tcsh users -- gives a nicer login prompt, and updates the terminal window title bar.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set prompt="%B%m%b{%h}%# " | |
set echo_style=both | |
bindkey ' ' magic-space | |
if ( -f /usr/bin/stty ) then | |
stty sane | |
endif | |
switch ($term) | |
case "wterm": | |
case "xterm*": | |
case "dtterm": | |
# red | |
set fg_default=`tput op` | |
set fg_black=`tput setaf 0` | |
set fg_red=`tput setaf 1` | |
set fg_green=`tput setaf 2` | |
set fg_yellow=`tput setaf 3` | |
set fg_blue=`tput setaf 4` | |
set fg_magenta=`tput setaf 5` | |
set fg_cyan=`tput setaf 6` | |
set fg_white=`tput setaf 7` | |
set myterm=$term | |
set prompt="%{${fg_green}%}%n%{${fg_default}%}%b@%U%{${fg_blue}%}%m%{${fg_default}%}%u{%h}%# " | |
alias precmd 'echo -n "\e]0;${HOST}:${cwd}\a"' | |
breaksw | |
default | |
endsw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I used tcsh, I had something like this in my precmd.
-- taken directly from the man page.
It puts the currently running command in the title bar. There's also jobcmd, but I'm not sure the tcsh I was using had that.