Fix zsh daemon tests: disable hostname and user before testing select

Reason: hostname and user do not have stable width and select prompt width with 
daemon depends on previous prompt width.
This commit is contained in:
ZyX 2014-08-02 21:56:37 +04:00
parent 9da3e04bc2
commit 28aee92c51
3 changed files with 20 additions and 16 deletions

View File

@ -1,4 +1,4 @@
unsetopt promptsp transientrprompt
unsetopt promptsp notransientrprompt
setopt interactivecomments
# POWERLINE_CONFIG_PATH=$PWD/powerline/config_files
# POWERLINE_THEME_CONFIG=( default_leftonly.segment_data.hostname.args.only_if_ssh=false )
@ -16,12 +16,6 @@ VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
VIRTUAL_ENV=
bash -c 'echo $$>pid ; while true ; do sleep 0.1s ; done' &
false
select abc in def ghi jkl
do
echo $abc
break
done
1
kill `cat pid` ; sleep 1s
cd "$DIR1"
cd ../"$DIR2"
@ -37,5 +31,13 @@ POWERLINE_COMMAND=( $POWERLINE_COMMAND[1,4] ${${POWERLINE_COMMAND[5]}/_leftonly}
echo abc
false
POWERLINE_COMMAND=( $POWERLINE_COMMAND -t default.segment_data.hostname.display=false )
POWERLINE_COMMAND=( $POWERLINE_COMMAND -t default.segment_data.user.display=false )
select abc in def ghi jkl
do
echo $abc
break
done
1
true is the last line
exit

Binary file not shown.

View File

@ -6,15 +6,7 @@
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  bash -c 'echo $$>pid ; while true ; do sleep 0.1s ; done' &
[1] PID
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  select abc in def ghi jkl
 select  do
 select   echo $abc
 select   break
 select  done
1) def 2) ghi 3) jkl
 Select variant  1
def
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  kill `cat pid` ; sleep 1s
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1] + terminated bash -c 'echo $$>pid ; while true ; do sleep 0.1s ; done'
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  cd "$DIR1"
  HOSTNAME  USER   BRANCH  ⋯  shell  3rd  ^[[32m  cd ../"$DIR2"
@ -31,3 +23,13 @@ def
 INSERT   HOSTNAME  USER  ⋯  tests  shell  3rd  echo abc
abc
 INSERT   HOSTNAME  USER  ⋯  tests  shell  3rd  false
 INSERT   HOSTNAME  USER  ⋯  tests  shell  3rd  POWERLINE_COMMAND=( $POWERLINE_COMMAND -t default.segment_data.hostname.display=false )
 INSERT  USER  ⋯  tests  shell  3rd  POWERLINE_COMMAND=( $POWERLINE_COMMAND -t default.segment_data.user.display=false )
 INSERT  ⋯  tests  shell  3rd  select abc in def ghi jkl
 select  do
 select   echo $abc
 select   break
 select  done
1) def 2) ghi 3) jkl
 Select variant  1
def