From 3f6ea607b5e79288acac1067d3e6fa916a9136f8 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Tue, 14 Sep 2021 15:53:23 -0700 Subject: [PATCH] themes/agnoster: lint --- themes/agnoster/agnoster.theme.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/agnoster/agnoster.theme.bash b/themes/agnoster/agnoster.theme.bash index ba3e2c9a..20c184f3 100644 --- a/themes/agnoster/agnoster.theme.bash +++ b/themes/agnoster/agnoster.theme.bash @@ -1,4 +1,5 @@ # shellcheck shell=bash +# shellcheck disable=SC2034 # Expected behavior for themes. # vim: ft=bash ts=2 sw=2 sts=2 # # agnoster's Theme - https://gist.github.com/3712874 @@ -220,7 +221,7 @@ prompt_virtualenv() { # Context: user@hostname (who am I and where am I) prompt_context() { - local user=$(whoami) + local user="${USER:-${LOGNAME:?}}" if [[ $user != "$DEFAULT_USER" || -n $SSH_CLIENT ]]; then prompt_segment black default "$user@\h"