Support multiline prompt in bash

This commit is contained in:
ZyX 2014-06-23 08:48:54 +04:00
parent 61006d8fe1
commit eb014efddb
1 changed files with 7 additions and 1 deletions

View File

@ -28,9 +28,15 @@ _powerline_init_tmux_support() {
fi
}
_run_powerline() {
# Arguments: side, last_exit_code, jobnum
$POWERLINE_COMMAND shell $1 -w $COLUMNS -r bash_prompt --last_exit_code=$2 --jobnum=$3
}
_powerline_prompt() {
local last_exit_code=$?
PS1="$($POWERLINE_COMMAND shell left -r bash_prompt --last_exit_code=$last_exit_code --jobnum="$(jobs -p|wc -l)")"
local jobnum="$(jobs -p|wc -l)"
PS1="$(_run_powerline aboveleft $last_exit_code $jobnum)"
_powerline_tmux_set_pwd
return $last_exit_code
}