mirror of
https://github.com/powerline/powerline.git
synced 2025-07-26 07:16:31 +02:00
Do not use _POWERLINE_SHORTENED_PATH or unset it shortly after using
Fixes #1068
This commit is contained in:
parent
9e686823a5
commit
c8b1334969
@ -129,6 +129,7 @@ class Prompt(object):
|
||||
|
||||
def __str__(self):
|
||||
zsh.eval('_POWERLINE_PARSER_STATE="${(%):-%_}"')
|
||||
zsh.eval('_POWERLINE_SHORTENED_PATH="${(%):-%~}"')
|
||||
segment_info = {
|
||||
'args': self.args,
|
||||
'environ': environ,
|
||||
@ -137,6 +138,8 @@ class Prompt(object):
|
||||
'parser_state': zsh.getvalue('_POWERLINE_PARSER_STATE'),
|
||||
'shortened_path': zsh.getvalue('_POWERLINE_SHORTENED_PATH'),
|
||||
}
|
||||
zsh.setvalue('_POWERLINE_PARSER_STATE', None)
|
||||
zsh.setvalue('_POWERLINE_SHORTENED_PATH', None)
|
||||
r = ''
|
||||
if self.above:
|
||||
for line in self.powerline.render_above_lines(
|
||||
|
@ -103,10 +103,6 @@ _powerline_set_jobnum() {
|
||||
_POWERLINE_JOBNUM=${(%):-%j}
|
||||
}
|
||||
|
||||
_powerline_set_shortened_path() {
|
||||
_POWERLINE_SHORTENED_PATH="${(%):-%~}"
|
||||
}
|
||||
|
||||
_powerline_update_counter() {
|
||||
zpython '_powerline.precmd()'
|
||||
}
|
||||
@ -120,8 +116,6 @@ _powerline_setup_prompt() {
|
||||
fi
|
||||
done
|
||||
precmd_functions+=( _powerline_set_jobnum )
|
||||
chpwd_functions+=( _powerline_set_shortened_path )
|
||||
_powerline_set_shortened_path
|
||||
|
||||
VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||
|
||||
@ -144,7 +138,7 @@ _powerline_setup_prompt() {
|
||||
add_args+=' --last_exit_code=$?'
|
||||
add_args+=' --last_pipe_status="$pipestatus"'
|
||||
add_args+=' --renderer_arg="client_id=$$"'
|
||||
add_args+=' --renderer_arg="shortened_path=$_POWERLINE_SHORTENED_PATH"'
|
||||
add_args+=' --renderer_arg="shortened_path=${(%):-%~}"'
|
||||
add_args+=' --jobnum=$_POWERLINE_JOBNUM'
|
||||
local new_args_2=' --renderer_arg="parser_state=${(%%):-%_}"'
|
||||
new_args_2+=' --renderer_arg="local_theme=continuation"'
|
||||
|
Loading…
x
Reference in New Issue
Block a user