mirror of
https://github.com/powerline/powerline.git
synced 2025-07-27 07:44:36 +02:00
Add client_id renderer argument to all shell bindings
This commit is contained in:
parent
c8cc7e464e
commit
498da5362e
@ -41,7 +41,12 @@ _powerline_init_tmux_support() {
|
|||||||
|
|
||||||
_powerline_prompt() {
|
_powerline_prompt() {
|
||||||
# Arguments: side, last_exit_code, jobnum
|
# Arguments: side, last_exit_code, jobnum
|
||||||
$POWERLINE_COMMAND shell $1 -w "${COLUMNS:-$(_powerline_columns_fallback)}" -r bash_prompt --last_exit_code=$2 --jobnum=$3
|
$POWERLINE_COMMAND shell $1 \
|
||||||
|
-w "${COLUMNS:-$(_powerline_columns_fallback)}" \
|
||||||
|
-r bash_prompt \
|
||||||
|
--last_exit_code=$2 \
|
||||||
|
--jobnum=$3 \
|
||||||
|
--renderer_arg="client_id=$$"
|
||||||
}
|
}
|
||||||
|
|
||||||
_powerline_set_prompt() {
|
_powerline_set_prompt() {
|
||||||
|
@ -34,6 +34,9 @@ function powerline-setup
|
|||||||
set -l addargs "--last_exit_code=\$status"
|
set -l addargs "--last_exit_code=\$status"
|
||||||
set -l addargs "$addargs --last_pipe_status=\$status"
|
set -l addargs "$addargs --last_pipe_status=\$status"
|
||||||
set -l addargs "$addargs --jobnum=(jobs -p | wc -l)"
|
set -l addargs "$addargs --jobnum=(jobs -p | wc -l)"
|
||||||
|
# One random value has an 1/32767 = 0.0031% probability of having
|
||||||
|
# the same value in two shells
|
||||||
|
set -l addargs "$addargs --renderer_arg=client_id="(random)
|
||||||
set -l addargs "$addargs --width=\$_POWERLINE_COLUMNS"
|
set -l addargs "$addargs --width=\$_POWERLINE_COLUMNS"
|
||||||
set -l promptside
|
set -l promptside
|
||||||
set -l rpromptpast
|
set -l rpromptpast
|
||||||
|
@ -134,7 +134,12 @@ _powerline_set_jobs() {
|
|||||||
_powerline_prompt() {
|
_powerline_prompt() {
|
||||||
# Arguments: side, exit_code
|
# Arguments: side, exit_code
|
||||||
_powerline_set_jobs
|
_powerline_set_jobs
|
||||||
$POWERLINE_COMMAND shell $1 -w "${COLUMNS:-$(_powerline_columns_fallback)}" $_POWERLINE_RENDERER_ARG --last_exit_code=$2 --jobnum=$_POWERLINE_JOBS
|
$POWERLINE_COMMAND shell $1 \
|
||||||
|
-w "${COLUMNS:-$(_powerline_columns_fallback)}" \
|
||||||
|
$_POWERLINE_RENDERER_ARG \
|
||||||
|
--renderer_arg="client_id=$$" \
|
||||||
|
--last_exit_code=$2 \
|
||||||
|
--jobnum=$_POWERLINE_JOBS
|
||||||
}
|
}
|
||||||
|
|
||||||
_powerline_setup_prompt() {
|
_powerline_setup_prompt() {
|
||||||
|
@ -24,11 +24,11 @@ if ( { $POWERLINE_CONFIG shell --shell=tcsh uses prompt } ) then
|
|||||||
if ( $?POWERLINE_NO_TCSH_ABOVE || $?POWERLINE_NO_SHELL_ABOVE ) then
|
if ( $?POWERLINE_NO_TCSH_ABOVE || $?POWERLINE_NO_SHELL_ABOVE ) then
|
||||||
alias _powerline_above true
|
alias _powerline_above true
|
||||||
else
|
else
|
||||||
alias _powerline_above '$POWERLINE_COMMAND shell above --last_exit_code=$POWERLINE_STATUS --width=$POWERLINE_COLUMNS'
|
alias _powerline_above '$POWERLINE_COMMAND shell above --renderer_arg=client_id=$$ --last_exit_code=$POWERLINE_STATUS --width=$POWERLINE_COLUMNS'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
alias _powerline_set_prompt 'set prompt="`$POWERLINE_COMMAND shell left -r tcsh_prompt --last_exit_code=$POWERLINE_STATUS --width=$POWERLINE_COLUMNS`"'
|
alias _powerline_set_prompt 'set prompt="`$POWERLINE_COMMAND shell left -r tcsh_prompt --renderer_arg=client_id=$$ --last_exit_code=$POWERLINE_STATUS --width=$POWERLINE_COLUMNS`"'
|
||||||
alias _powerline_set_rprompt 'set rprompt="`$POWERLINE_COMMAND shell right -r tcsh_prompt --last_exit_code=$POWERLINE_STATUS --width=$POWERLINE_COLUMNS` "'
|
alias _powerline_set_rprompt 'set rprompt="`$POWERLINE_COMMAND shell right -r tcsh_prompt --renderer_arg=client_id=$$ --last_exit_code=$POWERLINE_STATUS --width=$POWERLINE_COLUMNS` "'
|
||||||
alias _powerline_set_columns 'set POWERLINE_COLUMNS=`stty size|cut -d" " -f2` ; set POWERLINE_COLUMNS=`expr $POWERLINE_COLUMNS - 2`'
|
alias _powerline_set_columns 'set POWERLINE_COLUMNS=`stty size|cut -d" " -f2` ; set POWERLINE_COLUMNS=`expr $POWERLINE_COLUMNS - 2`'
|
||||||
|
|
||||||
alias precmd 'set POWERLINE_STATUS=$? ; '"`alias precmd`"' ; _powerline_set_columns ; _powerline_above ; _powerline_set_prompt ; _powerline_set_rprompt'
|
alias precmd 'set POWERLINE_STATUS=$? ; '"`alias precmd`"' ; _powerline_set_columns ; _powerline_above ; _powerline_set_prompt ; _powerline_set_rprompt'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user