IT

Changing the background colour for on remote server via SSH

Once I managed to shutdown a server. At the end of the day I wanted to shutdown my notebook, so I switched to the workspace with my terminals open, and typed sudo halt.

I noticed pretty soon that my notebook didn’t halt, instead I lost the connection to a remote host, because I typed the command in the wrong terminal.

The solution is to make the terminal background colour somewhat different, eg. to make it reddish. The following command does the trick:

printf ‘\033]11;#9e0e2a\007’

You have several options.

1. Add it to the .profile on the remote host

2. Create an alias for ssh:

alias s=”printf ‘\033]11;#9e0e2a\007’; ssh”

You can have an alias to revert the bgcolor back to black:

alias black=”printf ‘\033]11;black\007′”