Avoid using overrides in $POWERLINE_COMMAND

This commit is contained in:
ZyX 2015-01-07 00:17:56 +03:00
parent 2b880c4a54
commit 4d35167b13
16 changed files with 95 additions and 54 deletions

View File

@ -37,6 +37,8 @@ Vim configuration can be overridden using the following options:
was configured in :ref:`log_* options <config-common-log>`. Level is always was configured in :ref:`log_* options <config-common-log>`. Level is always
:ref:`log_level <config-common-log_level>`, same for format. :ref:`log_level <config-common-log_level>`, same for format.
.. _local-configuration-overrides-script:
Powerline script overrides Powerline script overrides
========================== ==========================
@ -69,7 +71,10 @@ Powerline script has a number of options controlling powerline behavior. Here
.. warning:: .. warning::
Such overrides are suggested for testing purposes only. Use Such overrides are suggested for testing purposes only. Use
:ref:`Environment variables overrides` for other purposes. :ref:`Environment variables overrides <local-configuration-overrides-env>`
for other purposes.
.. _local-configuration-overrides-env:
Environment variables overrides Environment variables overrides
=============================== ===============================
@ -143,14 +148,16 @@ searched for configuration.
.. note:: .. note::
Overrides from environment variables have lower priority then Overrides from environment variables have lower priority then
:ref:`Powerline script overrides`. Latter are suggested for tests only. :ref:`Powerline script overrides <local-configuration-overrides-script>`.
Latter are suggested for tests only.
Zsh/zpython overrides Zsh/zpython overrides
===================== =====================
Here overrides are controlled by similarly to the powerline script, but values Here overrides are controlled by similarly to the powerline script, but values
are taken from zsh variables. :ref:`Environment variable overrides` are also are taken from zsh variables. :ref:`Environment variable overrides
supported: if variable is a string this variant is used. <local-configuration-overrides-env>` are also supported: if variable is a string
this variant is used.
``POWERLINE_CONFIG_OVERRIDES`` ``POWERLINE_CONFIG_OVERRIDES``
Overrides options from :file:`powerline/config.json`. Should be a zsh Overrides options from :file:`powerline/config.json`. Should be a zsh
@ -210,7 +217,9 @@ putting powerline into different directory.
``$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 tmux it is passed to ``eval`` and specify additional parameters in bash. In tmux it is passed to ``eval`` and
depends on the shell used. POSIX-compatible shells, zsh, bash and fish will depends on the shell used. POSIX-compatible shells, zsh, bash and fish will
split this variable in this case. split this variable in this case. Do not use this feature for overriding
configuration: there are :ref:`Environment variables overrides
<local-configuration-overrides-env>`.
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

View File

@ -7,8 +7,8 @@
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1]+ Terminated bgscript.sh [1]+ Terminated bgscript.sh
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.display=false"   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false
 USER   BRANCH  ⋯  tests  shell  3rd  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.user.display=false"  USER   BRANCH  ⋯  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  ⋯  tests  shell  3rd  echo '   BRANCH  ⋯  tests  shell  3rd  echo '
                                     abc                                      abc
                                     def                                      def
@ -26,5 +26,5 @@ def
  BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'   BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'
  BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'   BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'
  BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'   BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'
  BRANCH  ⋯  shell  3rd  «Unicode!»  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.dividers.left.hard=\$ABC"   BRANCH  ⋯  shell  3rd  «Unicode!»  set_theme_option default_leftonly.dividers.left.hard \$ABC
  BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse   BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse

View File

@ -7,8 +7,8 @@
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1]+ Terminated bgscript.sh [1]+ Terminated bgscript.sh
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.display=false"   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false
 USER   BRANCH  ⋯  tests  shell  3rd  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.user.display=false"  USER   BRANCH  ⋯  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  ⋯  tests  shell  3rd  echo '   BRANCH  ⋯  tests  shell  3rd  echo '
   abc    abc
   def    def
@ -26,5 +26,5 @@ def
  BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'   BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'
  BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'   BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'
  BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'   BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'
  BRANCH  ⋯  shell  3rd  «Unicode!»  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.dividers.left.hard=\$ABC"   BRANCH  ⋯  shell  3rd  «Unicode!»  set_theme_option default_leftonly.dividers.left.hard \$ABC
  BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse   BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse

View File

@ -6,8 +6,8 @@
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1]+ Terminated bgscript.sh [1]+ Terminated bgscript.sh
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.display=false"   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  set_theme_option default_leftonly.segment_data.hostname.display false
 USER   BRANCH  ⋯  tests  shell  3rd  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.user.display=false"  USER   BRANCH  ⋯  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  ⋯  tests  shell  3rd  echo '   BRANCH  ⋯  tests  shell  3rd  echo '
                                     abc                                      abc
                                     def                                      def
@ -25,5 +25,5 @@ def
  BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'   BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'
  BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'   BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'
  BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'   BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'
  BRANCH  ⋯  shell  3rd  «Unicode!»  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.dividers.left.hard=\$ABC"   BRANCH  ⋯  shell  3rd  «Unicode!»  set_theme_option default_leftonly.dividers.left.hard \$ABC
  BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse   BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse

View File

@ -6,8 +6,8 @@
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1]+ Terminated bgscript.sh [1]+ Terminated bgscript.sh
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.display=false"   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  set_theme_option default_leftonly.segment_data.hostname.display false
 USER   BRANCH  ⋯  tests  shell  3rd  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.user.display=false"  USER   BRANCH  ⋯  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  ⋯  tests  shell  3rd  echo '   BRANCH  ⋯  tests  shell  3rd  echo '
   abc    abc
   def    def
@ -25,5 +25,5 @@ def
  BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'   BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'
  BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'   BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'
  BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'   BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'
  BRANCH  ⋯  shell  3rd  «Unicode!»  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.dividers.left.hard=\$ABC"   BRANCH  ⋯  shell  3rd  «Unicode!»  set_theme_option default_leftonly.dividers.left.hard \$ABC
  BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse   BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse

View File

@ -5,8 +5,8 @@
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  bgscript.sh & waitpid.sh
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.display=false" set_theme_option default_leftonly.segment_data.hostname.display false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1   USER   BRANCH  ⋯  tests  shell  3rd  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.user.display=false"   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1   USER   BRANCH  ⋯  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  ⋯  tests  shell  3rd  echo '   BRANCH  ⋯  tests  shell  3rd  echo '
                                     abc                                      abc
                                     def                                      def
@ -24,5 +24,5 @@ def
  BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'   BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'
  BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'   BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'
  BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'   BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'
  BRANCH  ⋯  shell  3rd  «Unicode!»  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.dividers.left.hard=\$ABC"   BRANCH  ⋯  shell  3rd  «Unicode!»  set_theme_option default_leftonly.dividers.left.hard \$ABC
  BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse   BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse

View File

@ -5,8 +5,8 @@
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  bgscript.sh & waitpid.sh
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.display=false" set_theme_option default_leftonly.segment_data.hostname.display false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1   USER   BRANCH  ⋯  tests  shell  3rd  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.user.display=false"   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1   USER   BRANCH  ⋯  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  ⋯  tests  shell  3rd  echo '   BRANCH  ⋯  tests  shell  3rd  echo '
   abc    abc
   def    def
@ -24,5 +24,5 @@ def
  BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'   BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'
  BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'   BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'
  BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'   BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'
  BRANCH  ⋯  shell  3rd  «Unicode!»  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.dividers.left.hard=\$ABC"   BRANCH  ⋯  shell  3rd  «Unicode!»  set_theme_option default_leftonly.dividers.left.hard \$ABC
  BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse   BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse

View File

@ -1,7 +1,13 @@
set_theme_option() {
export POWERLINE_THEME_OVERRIDES="${POWERLINE_THEME_OVERRIDES};$1=$2"
}
set_theme() {
export POWERLINE_CONFIG_OVERRIDES="ext.shell.theme=$1"
}
set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false
set_theme default_leftonly
export VIRTUAL_ENV= export VIRTUAL_ENV=
source powerline/bindings/bash/powerline.sh source powerline/bindings/bash/powerline.sh
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.args.only_if_ssh=false"
POWERLINE_COMMAND="$POWERLINE_COMMAND -c ext.shell.theme=default_leftonly"
cd tests/shell/3rd cd tests/shell/3rd
cd .git cd .git
cd .. cd ..
@ -10,8 +16,8 @@ VIRTUAL_ENV=
bgscript.sh & waitpid.sh bgscript.sh & waitpid.sh
false false
kill `cat pid` ; sleep 1s kill `cat pid` ; sleep 1s
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.display=false" set_theme_option default_leftonly.segment_data.hostname.display false
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.user.display=false" set_theme_option default_leftonly.segment_data.user.display false
echo ' echo '
abc abc
def def
@ -25,7 +31,7 @@ cd ../'(echo)'
cd ../'$(echo)' cd ../'$(echo)'
cd ../'`echo`' cd ../'`echo`'
cd ../'«Unicode!»' cd ../'«Unicode!»'
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.dividers.left.hard=\$ABC" set_theme_option default_leftonly.dividers.left.hard \$ABC
false false
true is the last line true is the last line
exit exit

View File

@ -1,6 +1,12 @@
set_theme_option() {
export POWERLINE_THEME_OVERRIDES="${POWERLINE_THEME_OVERRIDES};$1=$2"
}
set_theme() {
export POWERLINE_CONFIG_OVERRIDES="ext.shell.theme=$1"
}
set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false
set_theme default_leftonly
. powerline/bindings/shell/powerline.sh . powerline/bindings/shell/powerline.sh
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.args.only_if_ssh=false"
POWERLINE_COMMAND="$POWERLINE_COMMAND -c ext.shell.theme=default_leftonly"
export VIRTUAL_ENV= export VIRTUAL_ENV=
cd tests/shell/3rd cd tests/shell/3rd
cd .git cd .git
@ -10,8 +16,8 @@ VIRTUAL_ENV=
bgscript.sh & waitpid.sh bgscript.sh & waitpid.sh
false false
kill `cat pid` ; sleep 1s kill `cat pid` ; sleep 1s
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.display=false" set_theme_option default_leftonly.segment_data.hostname.display false
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.user.display=false" set_theme_option default_leftonly.segment_data.user.display false
echo ' echo '
abc abc
def def
@ -25,7 +31,7 @@ cd ../'(echo)'
cd ../'$(echo)' cd ../'$(echo)'
cd ../'`echo`' cd ../'`echo`'
cd ../'«Unicode!»' cd ../'«Unicode!»'
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.dividers.left.hard=\$ABC" set_theme_option default_leftonly.dividers.left.hard \$ABC
false false
true is the last line true is the last line
exit exit

View File

@ -1,6 +1,12 @@
set_theme_option() {
export POWERLINE_THEME_OVERRIDES="${POWERLINE_THEME_OVERRIDES};$1=$2"
}
set_theme() {
export POWERLINE_CONFIG_OVERRIDES="ext.shell.theme=$1"
}
set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false
set_theme default_leftonly
. powerline/bindings/shell/powerline.sh . powerline/bindings/shell/powerline.sh
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.args.only_if_ssh=false"
POWERLINE_COMMAND="$POWERLINE_COMMAND -c ext.shell.theme=default_leftonly"
export VIRTUAL_ENV= export VIRTUAL_ENV=
cd tests/shell/3rd cd tests/shell/3rd
cd .git cd .git
@ -10,8 +16,8 @@ VIRTUAL_ENV=
bgscript.sh & waitpid.sh bgscript.sh & waitpid.sh
false false
kill `cat pid` ; sleep 1s kill `cat pid` ; sleep 1s
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.display=false" set_theme_option default_leftonly.segment_data.hostname.display false
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.user.display=false" set_theme_option default_leftonly.segment_data.user.display false
echo ' echo '
abc abc
def def
@ -25,7 +31,7 @@ cd ../'(echo)'
cd ../'$(echo)' cd ../'$(echo)'
cd ../'`echo`' cd ../'`echo`'
cd ../'«Unicode!»' cd ../'«Unicode!»'
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.dividers.left.hard=\$ABC" set_theme_option default_leftonly.dividers.left.hard \$ABC
false false
true is the last line true is the last line
exit exit

View File

@ -1,10 +1,16 @@
function set_theme_option
set -g -x POWERLINE_THEME_OVERRIDES "$POWERLINE_THEME_OVERRIDES;$argv[1]=$argv[2]"
end
function set_theme
set -g -x POWERLINE_CONFIG_OVERRIDES "ext.shell.theme=$argv"
end
set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false
set_theme default_leftonly
set fish_function_path "$PWD/powerline/bindings/fish" $fish_function_path set fish_function_path "$PWD/powerline/bindings/fish" $fish_function_path
while jobs | grep fish_update_completions while jobs | grep fish_update_completions
sleep 1 sleep 1
end end
powerline-setup powerline-setup
set POWERLINE_COMMAND "$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.args.only_if_ssh=false"
set POWERLINE_COMMAND "$POWERLINE_COMMAND -c ext.shell.theme=default_leftonly"
setenv VIRTUAL_ENV setenv VIRTUAL_ENV
cd tests/shell/3rd cd tests/shell/3rd
cd .git cd .git
@ -23,7 +29,7 @@ cd ../'(echo)'
cd ../'$(echo)' cd ../'$(echo)'
cd ../'`echo`' cd ../'`echo`'
cd ../'«Unicode!»' cd ../'«Unicode!»'
set POWERLINE_COMMAND "$POWERLINE_COMMAND -c ext.shell.theme=default" set_theme default
set -g fish_key_bindings fish_vi_key_bindings set -g fish_key_bindings fish_vi_key_bindings
ii ii
false false

View File

@ -1,6 +1,12 @@
set_theme_option() {
export POWERLINE_THEME_OVERRIDES="${POWERLINE_THEME_OVERRIDES};$1=$2"
}
set_theme() {
export POWERLINE_CONFIG_OVERRIDES="ext.shell.theme=$1"
}
set_theme default_leftonly
set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false
. powerline/bindings/shell/powerline.sh . powerline/bindings/shell/powerline.sh
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.args.only_if_ssh=false"
POWERLINE_COMMAND="$POWERLINE_COMMAND -c ext.shell.theme=default_leftonly"
export VIRTUAL_ENV= export VIRTUAL_ENV=
cd tests/shell/3rd cd tests/shell/3rd
cd .git cd .git
@ -10,8 +16,8 @@ VIRTUAL_ENV=
bgscript.sh & waitpid.sh bgscript.sh & waitpid.sh
false false
kill `cat pid` ; sleep 1 kill `cat pid` ; sleep 1
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.display=false" set_theme_option default_leftonly.segment_data.hostname.display false
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.user.display=false" set_theme_option default_leftonly.segment_data.user.display false
echo -n echo -n
echo ' echo '
abc abc
@ -26,7 +32,7 @@ cd ../'(echo)'
cd ../'$(echo)' cd ../'$(echo)'
cd ../'`echo`' cd ../'`echo`'
cd ../'«Unicode!»' cd ../'«Unicode!»'
POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.dividers.left.hard=\$ABC" set_theme_option default_leftonly.dividers.left.hard \$ABC
false false
true is the last line true is the last line
exit exit

View File

@ -1,5 +1,6 @@
setenv POWERLINE_THEME_OVERRIDES "default_leftonly.segment_data.hostname.args.only_if_ssh=false"
setenv POWERLINE_CONFIG_OVERRIDES "ext.shell.theme=default_leftonly"
source powerline/bindings/tcsh/powerline.tcsh source powerline/bindings/tcsh/powerline.tcsh
set POWERLINE_COMMAND=$POWERLINE_COMMAND:q" -t default_leftonly.segment_data.hostname.args.only_if_ssh=false -c ext.shell.theme=default_leftonly"
unsetenv VIRTUAL_ENV unsetenv VIRTUAL_ENV
cd tests/shell/3rd cd tests/shell/3rd
cd .git cd .git

View File

@ -8,8 +8,8 @@
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1
[1] + Terminated bash -c ... [1] + Terminated bash -c ...
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.display=false"   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false
 USER   BRANCH  ⋯  tests  shell  3rd  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.user.display=false"  USER   BRANCH  ⋯  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  ⋯  tests  shell  3rd  echo -n   BRANCH  ⋯  tests  shell  3rd  echo -n
  BRANCH  ⋯  tests  shell  3rd  echo '   BRANCH  ⋯  tests  shell  3rd  echo '
                                     abc                                      abc
@ -28,5 +28,5 @@ def
  BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'   BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'
  BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'   BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'
  BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'   BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'
  BRANCH  ⋯  shell  3rd  «Unicode!»  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.dividers.left.hard=\$ABC"   BRANCH  ⋯  shell  3rd  «Unicode!»  set_theme_option default_leftonly.dividers.left.hard \$ABC
  BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse   BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse

View File

@ -8,8 +8,8 @@
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1
[1] + Terminated bash -c ... [1] + Terminated bash -c ...
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.display=false"   HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false
 USER   BRANCH  ⋯  tests  shell  3rd  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.segment_data.user.display=false"  USER   BRANCH  ⋯  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  ⋯  tests  shell  3rd  echo -n   BRANCH  ⋯  tests  shell  3rd  echo -n
  BRANCH  ⋯  tests  shell  3rd  echo '   BRANCH  ⋯  tests  shell  3rd  echo '
   abc    abc
@ -28,5 +28,5 @@ def
  BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'   BRANCH  ⋯  shell  3rd  (echo)  cd ../'$(echo)'
  BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'   BRANCH  ⋯  shell  3rd  $(echo)  cd ../'`echo`'
  BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'   BRANCH  ⋯  shell  3rd  `echo`  cd ../'«Unicode!»'
  BRANCH  ⋯  shell  3rd  «Unicode!»  POWERLINE_COMMAND="$POWERLINE_COMMAND -t default_leftonly.dividers.left.hard=\$ABC"   BRANCH  ⋯  shell  3rd  «Unicode!»  set_theme_option default_leftonly.dividers.left.hard \$ABC
  BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse   BRANCH $ABC⋯  shell  3rd  «Unicode!» $ABCfalse

View File

@ -78,7 +78,8 @@ run() {
PYTHONPATH="${PWD}${PYTHONPATH:+:}$PYTHONPATH" \ PYTHONPATH="${PWD}${PYTHONPATH:+:}$PYTHONPATH" \
POWERLINE_SHELL_CONTINUATION=$additional_prompts \ POWERLINE_SHELL_CONTINUATION=$additional_prompts \
POWERLINE_SHELL_SELECT=$additional_prompts \ POWERLINE_SHELL_SELECT=$additional_prompts \
POWERLINE_COMMAND="${POWERLINE_COMMAND} -p $PWD/powerline/config_files" \ POWERLINE_CONFIG_PATHS="$PWD/powerline/config_files" \
POWERLINE_COMMAND="${POWERLINE_COMMAND}" \
"$@" "$@"
} }