From 1ac547bf987fa137d13774d1700686cd3b049328 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 20 Feb 2023 17:38:59 -0300 Subject: etc/sh/rc: Show hostname in $PS1 if on SSH session on different desktop --- etc/sh/rc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/etc/sh/rc b/etc/sh/rc index a6ff24b..b49440a 100644 --- a/etc/sh/rc +++ b/etc/sh/rc @@ -243,8 +243,16 @@ in_nix_shell() { printf ')' } +in_ssh_session() { + if [ -n "${SSH_CLIENT:-}" ]; then + color -c blackb '\\u' + printf '@' + color -c purple '\\H' + fi +} + PS1='`error_marker`'$(timestamp)' '$(path)' `shell_status``vcs ps1``guix_env``in_nix_shell` -$ ' +'$(in_ssh_session)'$ ' -- cgit v1.2.3