Skip to content

Conversation

@clelange
Copy link

I'm using zsh for most of my work, which is currently not supported by the call_host.sh script. I've made it work by identifying the bash-specific parts and changing those to functions. I've also introduced a function to identify if zsh is used and another one to prevent duplicating the bind paths when accidentally sourcing the call_host.sh script more than once.

@kpedro88
Copy link
Contributor

@clelange thanks for this contribution! tagging @NJManganelli here because he had also expressed interest in zsh support.

I won't have time to review this in depth until next week, but I wanted to acknowledge receipt.

@kpedro88
Copy link
Contributor

In the meantime, you can try to placate shellcheck...

@NJManganelli
Copy link

I had hacked together a minimal translation and had no time to clean it up, but even at a glance this is better and more functional. I can hopefully test it as a replacement for my hacked version later

@clelange
Copy link
Author

clelange commented Nov 4, 2025

In the meantime, you can try to placate shellcheck...

This should be OK now.

}
# declare an associative array (zsh) - create a named array using eval so dynamic name works
declare_assoc(){
eval "typeset -A $1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if eval necessary here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, in zsh, typeset -A $1 would try to create an array literally named $1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I just enter /bin/zsh, the following works as the similar test did above for bash:

TEST1=TEST2
typeset -A $TEST1
TEST2[foo]=bar
echo "${TEST2[@]}"

output:

bar

@clelange
Copy link
Author

clelange commented Nov 6, 2025

Thanks for the careful review. I'm not sure I'll be able to address everything this week, but if not, I'll pick this up in the second half of next week.

@kpedro88
Copy link
Contributor

@clelange just checking on this

@clelange
Copy link
Author

Hey, yes, it's on my list but I haven't managed to get back to it yet.

@clelange
Copy link
Author

I hope I have managed to address all suggestions @kpedro88

@kpedro88
Copy link
Contributor

@clelange everything looks good except the one remaining eval that still seems unnecessary to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants