mirror of
https://github.com/powerline/powerline.git
synced 2025-07-27 07:44:36 +02:00
Perform shell word splitting in zsh bindings
This makes POWERLINE_COMMAND be consistent across various bindings.
This commit is contained in:
parent
dc76396912
commit
8e77262f2d
@ -122,11 +122,9 @@ powerline into different directory.
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
``$POWERLINE_COMMAND`` appears in shell scripts without quotes thus you can
|
``$POWERLINE_COMMAND`` appears in shell scripts without quotes thus you can
|
||||||
specify additional parameters in bash. In zsh you will have to make
|
specify additional parameters in bash. In tmux it is passed to ``eval`` and
|
||||||
``$POWERLINE_COMMAND`` an array parameter to achieve the same result. In
|
depends on the shell used. POSIX-compatible shells, zsh, bash and fish will
|
||||||
tmux it is passed to ``eval`` and depends on the shell used.
|
split this variable in this case.
|
||||||
POSIX-compatible shells, zsh, bash and fish will split this variable in this
|
|
||||||
case.
|
|
||||||
|
|
||||||
If you want to disable prompt in shell, but still have tmux support or if you
|
If you want to disable prompt in shell, but still have tmux support or if you
|
||||||
want to disable tmux support you can use variables
|
want to disable tmux support you can use variables
|
||||||
|
@ -131,7 +131,7 @@ _powerline_setup_prompt() {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
if test -z "${POWERLINE_COMMAND}" ; then
|
if test -z "${POWERLINE_COMMAND}" ; then
|
||||||
POWERLINE_COMMAND=( "$($POWERLINE_CONFIG shell command)" )
|
POWERLINE_COMMAND="$($POWERLINE_CONFIG shell command)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local add_args='-r .zsh'
|
local add_args='-r .zsh'
|
||||||
@ -145,11 +145,11 @@ _powerline_setup_prompt() {
|
|||||||
local add_args_2=$add_args$new_args_2
|
local add_args_2=$add_args$new_args_2
|
||||||
add_args+=' --width=$(( ${COLUMNS:-$(_powerline_columns_fallback)} - 1 ))'
|
add_args+=' --width=$(( ${COLUMNS:-$(_powerline_columns_fallback)} - 1 ))'
|
||||||
local add_args_r2=$add_args$new_args_2
|
local add_args_r2=$add_args$new_args_2
|
||||||
PS1='$($POWERLINE_COMMAND shell aboveleft '$add_args')'
|
PS1='$($=POWERLINE_COMMAND shell aboveleft '$add_args')'
|
||||||
RPS1='$($POWERLINE_COMMAND shell right '$add_args')'
|
RPS1='$($=POWERLINE_COMMAND shell right '$add_args')'
|
||||||
PS2='$($POWERLINE_COMMAND shell left '$add_args_2')'
|
PS2='$($=POWERLINE_COMMAND shell left '$add_args_2')'
|
||||||
RPS2='$($POWERLINE_COMMAND shell right '$add_args_r2')'
|
RPS2='$($=POWERLINE_COMMAND shell right '$add_args_r2')'
|
||||||
PS3='$($POWERLINE_COMMAND shell left '$add_args_3')'
|
PS3='$($=POWERLINE_COMMAND shell left '$add_args_3')'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user