Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So you want to change terminal colors and resetting them back on exit? It's possible!

Thanks to .ssh/config, alias and setterm.

share|improve this question
    
I know, we have tons of such questions, but I just did not found any simple as my current version. Also to those, who can expand my answer with details, pls expand it. Then after more detailed version we can accept it. –  gaRex Jun 5 '13 at 8:13

1 Answer 1

.bash_aliases

function ssh_alias() {
    ssh $@;
    setterm -default -clear rest;
}

alias ssh=ssh_alias

/etc/ssh/ssh_config

# Make sure you have this line there:
PermitLocalCommand yes

.ssh/config

Host your.production.host
  User root
  LocalCommand setterm -term linux -back red -fore white -clear rest

Now you can in bash:

some command
# all in default colors
ssh your.production.host
# colors changed
# ....
exit
# colors changed back! yeea!
share|improve this answer
    
This is exactly what I was looking for after googling it for hours. –  MonkeyMonkey Nov 5 at 16:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.