summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2024-12-12 08:31:51 +0100
committerMartin Fischer <martin@push-f.com>2024-12-12 08:32:40 +0100
commitdda8485d57bc59bd4781ea43cf1dc200351afebe (patch)
tree13a443388f8ab1ca91306f256c0f7dffc7e7db5b /user
parentd17efc051d99e27abd44655acaf508e360c41bac (diff)
enable SSH host-specific terminal background colors
Diffstat (limited to 'user')
-rw-r--r--user/zsh/zshrc-graphical.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/user/zsh/zshrc-graphical.sh b/user/zsh/zshrc-graphical.sh
index d60c15a..678448e 100644
--- a/user/zsh/zshrc-graphical.sh
+++ b/user/zsh/zshrc-graphical.sh
@@ -1,5 +1,16 @@
# This file is sourced by .zshrc if parts/graphical.nix was imported.
+function ssh() {
+ # In my ~/.ssh/config I configure host-specific background colors, for example:
+ #
+ # Host forest
+ # LocalCommand set-bg 003300
+ #
+ # Since SSH doesn't provide a way of running a command on exit, this shell
+ # function takes care of resetting the background color on exit.
+ command ssh "$@"; reset-bg
+}
+
if [ $TERM = foot ]; then
# Enable spawning of new terminal instances in the current working directory
function osc7-pwd() {