From 4e6c8e13afa87e3f425adf50cae4d0153a7e8d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Mon, 6 Mar 2023 11:44:38 +0100 Subject: [PATCH] feat(zsh): show hostname if in ssh --- configs/zsh.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configs/zsh.nix b/configs/zsh.nix index 91bf19b..89ea294 100644 --- a/configs/zsh.nix +++ b/configs/zsh.nix @@ -77,7 +77,11 @@ precmd () { vcs_info - RPROMPT="$vcs_info_msg_0_" + if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] || [ -n "$SSH_CONNECTION" ]; then + RPROMPT="$(hostname)" + else + RPROMPT="$vcs_info_msg_0_" + fi if [[ -n $IN_NIX_SHELL ]]; then PROMPT='%B%~%b %(?.%F{${promptColours.success}}.%F{${promptColours.failure}})λ%f ' else