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


Click here to return to the 'Why use a script? -hostname only?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Why use a script? -hostname only?
Authored by: baba on May 02, '02 08:42:35PM

Can this be done so that only the hostname displays in the title?



[ Reply to This | # ]
Re: Why use a script? -hostname only?
Authored by: sjk on May 02, '02 09:30:36PM
Generalized tcsh example:

alias xtitle printf '"\e]2;\!*\a"'

[There are backslashes before the 'e', '!', and 'a' characters in the argument to printf; this avoids using non-printable characters in the alias]

alias cwdcmd xtitle '$cwd'

Replace the argument to xtitle with whatever you want displayed in the Terminal title bar when changing directories in the shell, like:

alias cwdcmd xtitle '`dirs`'

Run:

unalias cwdcmd
xtitle anything

... to set the title bar to something that doesn't change.


[ Reply to This | # ]
Why use a script? -hostname only - success
Authored by: baba on May 03, '02 11:08:22AM

Ah, silly me. I got it to work by specifying machine name:
alias cd 'chdir <backslash>!*; set prompt="%{<backslash>033]0;%m<backslash>007%}[%~]%# "'
so now I have the host in the window and the current path at the prompt.
Most exellent.
The big question now is can I set the terminal background color according to the host??? Right now I keep a bunch of saved term sessions which specify colors for certain hosts. I'd rather it be automatic.



[ Reply to This | # ]