byobu-reconnect-sockets fails silently in zsh

Bug #923169 reported by Ryan Thompson on 2012-01-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Zsh by default does not split variables into multiple values, so when you do:

    for var in $VARS_TO_UPDATE; do ... done

in Zsh this is equivalent to

    for var in "$VARS_TO_UPDATE"; do ... done

One fix is to set some sh-compatibility options, but this is a bad idea because the zsh used is sourcing this script, so the compatibility options will persist in that shell I'm attaching a patch that wraps "$VARS_TO_UPDATE" inside $(echo ...), which forces word splitting and makes the script work when sourced from zsh. I've also tested the fix in bash, and it still works. Obviously if you target compatibility with any shells other than bash and zsh, you should test the fix in them too.

Ryan Thompson (rct86) wrote :
Dustin Kirkland  (kirkland) wrote :

Thanks, Ryan.

summary: - byoub-reconnect-sockets fails silently in zsh
+ byobu-reconnect-sockets fails silently in zsh
Changed in byobu:
importance: Undecided → Medium
status: New → Triaged
Dustin Kirkland  (kirkland) wrote :

Committed revision 1883.

Changed in byobu:
status: Triaged → Fix Committed
Daniel Hahler (blueyed) wrote :

Re-opening: the not-so-dirty fix might be to set the zsh compatibility option locally in the affected functions.

I am attaching a branch with this.

Changed in byobu:
status: Fix Committed → Confirmed
Ryan Thompson (rct86) wrote :

That sounds like a better idea. I'm not familiar how zsh's compatibility options, so if they can be set locally inside functions, that is indeed the better choice.

Dustin Kirkland  (kirkland) wrote :


Committed r1888.

Changed in byobu:
status: Confirmed → Fix Committed
Changed in byobu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers