Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A year later...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A year later...
Authored by: dpwk on Nov 29, '03 03:12:09AM
Oof! I spent too much time looking at this and all related hints I could find, and here is the synthesis I came up with- thanks to all the many people whose code appears in chunks here, you've given me a great education in all of this.

In my aliases.mine:

sched +0:00 alias postcmd 'printf "\033]0; %s \007" "`date "+%H:%M"` `echo -n "${cwd}"| sed -e "s%$HOME%~%"` => `history -h 1`"'

alias precmd 'printf "\033]0; %s \007" "`date "+%H:%M"`" ${cwd}"| sed -e "s%$HOME%~%"'

- prints time, cwd, current job
- works with aliased commands
- substitutes "~" for your home path
- doesn't add blank lines or obscure certain single line responses (as some of the other similar solutions did in my environment)
- doesn't use pesky escape sequences

also, more futzing on other hints elsewhere gave me this oh so fun prompt:

if ( $?prompt && $?tcsh ) then
  set BG_COL = 31
  alias inc_bg 'if ($BG_COL >= 37) @ BG_COL=30; @ BG_COL++'
  alias precmd 'set prompt="%{\033[${BG_COL};01m%}%B%m%b:%~ %h%# "; inc_bg'
  alias uncool 'unalias precmd; set prompt="%B%m%b:%~ %h%# "'

(put this in your .login, start a new shell, and hit return a few times.. you'll need a terminal that supports colors for this.)

now I'm wondering if I set up some sort of precmd collision here.. oh well, it all works, at least for now..

---
gigabling megashiznit

[ Reply to This | # ]