Skip to content

Instantly share code, notes, and snippets.

@gdamore
Created March 27, 2015 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdamore/20c2aae88d65a8e398bb to your computer and use it in GitHub Desktop.
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.
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
@myrkraverk
Copy link

When I used tcsh, I had something like this in my precmd.

alias postcmd  'echo -n "^[]2\;\!#:q^G"'

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment