Do you ever change the PS1 or terminal profile when connecting via SSH?
This will help you avoid wasting time wondering, 'Why isn't that file I just added in this directory?' {emo:onion-030.gif:50} while connected via SSH.
To implement this feature, you first need to override the ssh command in your SSH client.
Of course, there are many ways to override commands in Linux, but here we will introduce a simple way to set it up.
First, add the following shell script to a path with higher priority than /usr/bin (e.g., /usr/local/bin or ~/.local/bin ).
[code]#!/bin/bash
/usr/bin/ssh "$@"
# Reset the modified terminal profile on the SSH remote server to the default value
printf "\\e]111\\a"
printf "\\e]110\\a"[/code]
Then, add the following content to the remote shell profile of the target SSH connection.
[code]# omitted
if [ -n "$SSH_CONNECTION" ]; then
# Solarized dark theme
printf "\\e]11;#002b36\\a"
printf "\\e]10;#839496\\a"
fi
# omitted[/code]
Once all the work is done, you will be able to see a colorful terminal. {emo:onion-051.gif:50}