Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: two mysteries



On Nov 4, 10:12am, Ray Andrews wrote:
}
}      START_IDX=1+((idx-1)/page_hight)*page_hight
} 
} ... it will work fine for days, then one Tuesday 'START_IDX' starts 
} throwing 'divide by zero' errors

This would be because page_hight (sic) is zero, not because the type
of START_IDX has changed.

}      START_IDX=$(( 1+((idx-1)/page_hight)*page_hight ))
} 
} ... fixes it

I suspect not really.  Something else changed so that the "page" is
no longer empty, or whatever.

} playing with associative arrays, yesterday I had to single quote:
} 
}       varis 'array[value]' line456 5
} 
} ... but only with arrays--scalars were fine--or I got a message to the 
} effect that 'no values were matched'.

Without the quotes, array[value] is being treated as a file glob, and is
looking for a file named one of arrayv, arraya, arrayl, arrayu, arraye.
The "no matches found" error is because none of those files exists.

} In the same vein, if one of these 'zcurses' functions crashes, what the 
} docs say about the terminal being in a unstable state sure is true. 
} Things look fine, but, for example, history recall goes screwy.

"stty sane" will often fix you up in this situation.  It might also work
to use "ttyctl -f" in your startup file (i.e., before any zcurses stuff
is run) but I'm not sure that handles the case where a zsh builtin has
itself messed up the terminal state.



Messages sorted by: Reverse Date, Date, Thread, Author