Work better if $? is missing
This commit is contained in:
parent
e61cd1495f
commit
ab468beb64
1 changed files with 3 additions and 2 deletions
5
spp.pl
5
spp.pl
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/perl
|
||||
# Shiny perl prompt, lol
|
||||
# SHINY PERL PROMPT, lol
|
||||
# Use with : export PROMPT_COMMAND='eval "$(perl path/to/spp.pl $?)"'
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
@ -490,7 +491,7 @@ sub render_prevcmd
|
|||
my ( $ss , $sc , $pc , $cl ) = map {
|
||||
$CONFIG{ "pcmd_$_" }
|
||||
} qw( show_symbol show_code pad_code colors );
|
||||
my $status = $ARGV[0];
|
||||
my $status = scalar(@ARGV) ? $ARGV[0] : 255;
|
||||
$sc = ( $sc == 1 || ( $sc == 2 && $status ) );
|
||||
return () unless $sc || $ss;
|
||||
|
||||
|
|
Loading…
Reference in a new issue