summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-09-16 15:55:47 -0400
committerJesse Luehrs <doy@tozt.net>2013-09-16 16:14:09 -0400
commit571a1d67829295ee82f4988788f77c615caa5f92 (patch)
treebe7173a883b1af4a028c6da16895836028b92816 /bin
parent8f7459d04b6e168937c527c9e4e5ce904b7b891b (diff)
downloadconf-571a1d67829295ee82f4988788f77c615caa5f92.tar.gz
conf-571a1d67829295ee82f4988788f77c615caa5f92.zip
fallback for unreliable env
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fancy-prompt4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/fancy-prompt b/bin/fancy-prompt
index 18bc951..4927951 100755
--- a/bin/fancy-prompt
+++ b/bin/fancy-prompt
@@ -13,8 +13,8 @@ if ($ARGV[0] eq '--prompt-escape') {
# collect information
chomp(my $hostname = `hostname`);
my $cols = `tput cols`;
-my $pwd = $ENV{PWD};
-my $user = $ENV{USER};
+my $pwd = $ENV{PWD} // '???';
+my $user = $ENV{USER} // '???';
my $root = ($> == 0);
(my $time = localtime) =~ s/.*(\d\d:\d\d:\d\d).*/$1/;
my $err = $ARGV[0] || 0; # bash's $? is passed on the command line