Skip to content

Commit

Permalink
bash: shopt -s promptvars
Browse files Browse the repository at this point in the history
We are expecting variable expansion to occur, so set the shell option
accordingly.
  • Loading branch information
dolmen committed Jun 7, 2016
1 parent cb15544 commit 3103d6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/AngelPS1/Shell/bash.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sub ps1_finalize
sub shell_code_static
{
my ($class, $PS1, %options) = @_;
qq{[[ -n "\$APS1_NAME" ]] && \$APS1_NAME leave; PS1='$PS1'\n}
qq{[[ -n "\$APS1_NAME" ]] && \$APS1_NAME leave; shopt -s promptvars; PS1='$PS1'\n}
}

# Returns the code to send to the shell
Expand Down Expand Up @@ -66,6 +66,7 @@ APS1_PROMPT_COMMAND="\$PROMPT_COMMAND";
read PS1 < '$OUT' || $NAME leave ;
$shell_debug
} ;
shopt -s promptvars ;
PROMPT_COMMAND='${time_debug}-angel-PS1' ;
APS1_NAME=$NAME ;
APS1_PID=$PID ;
Expand Down

0 comments on commit 3103d6d

Please sign in to comment.