openziti / ziti

The parent project for OpenZiti. Here you will find the executables for a fully zero trust, application embedded, programmable network @OpenZiti
https://openziti.io
Apache License 2.0
2.69k stars 153 forks source link

read with -p option not supported on ZSH #555

Closed gberl002 closed 2 years ago

gberl002 commented 2 years ago

The read command with the -p option is not the same for zsh as zsh refers to reading from a coprocess. If running ZSH an error is presented and the script continues without setting the variable value.

In the worst case (do while input is invalid) this results in an infinite loop until the process is exited.

ZITI_HOME has not been set. Do you want to use the default ZITI_HOME: /Users/geoffberl/.ziti/quickstart/Geoffs-MBP

decideToUseDefaultZitiHome:read:6: -p: no coprocess

Answer  is not valid. Please answer yes or no. (y/n [yes/NO])
ZITI_HOME has not been set. Do you want to use the default ZITI_HOME: /Users/geoffberl/.ziti/quickstart/Geoffs-MBP

decideToUseDefaultZitiHome:read:6: -p: no coprocess

Answer  is not valid. Please answer yes or no. (y/n [yes/NO])
ZITI_HOME has not been set. Do you want to use the default ZITI_HOME: /Users/geoffberl/.ziti/quickstart/Geoffs-MBP

decideToUseDefaultZitiHome:read:6: -p: no coprocess

Answer  is not valid. Please answer yes or no. (y/n [yes/NO])
ZITI_HOME has not been set. Do you want to use the default ZITI_HOME: /Users/geoffberl/.ziti/quickstart/Geoffs-MBP

decideToUseDefaultZitiHome:read:6: -p: no coprocess

Recommendation: use echo -en "message" followed by a read command without the -p option

dovholuknf commented 2 years ago

Nice issue but probably belongs in openziti-test-kitchen/zssh

dovholuknf commented 2 years ago

Hey this is "zsh" not "zssh"... That is my bad. reopening...