byobu-reconnect-sockets fails silently in zsh

Bug #923169 reported by Ryan Thompson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
Fix Released
Medium
Unassigned

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.

Revision history for this message
Ryan Thompson (rct86) wrote :
Revision history for this message
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
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Committed revision 1883.

Changed in byobu:
status: Triaged → Fix Committed
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Thanks!

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.