On 2022-12-15 19:21, Lawrence Velázquez wrote:
Exactly the case here. This code has many global variables and ... well, no need to say more.Or before.
Wrong. It assumed that "main" contained the expected data and nothing extra. I've already asked you to use "typeset -p" to verify its actual contents, but you still haven't.
No need, zeroing the array solves the issue. Mind, I suppose I could do a forensic on that, and figure out when and where the corruption occurs, and then, of course I'll use typeset -p and let you know. Right now I have more pressing issues.
Variable crosstalk? How does an associative array get corrupted? Let me root around a bit ... hey ... you don't suppose a zcurses crash might do it?It's far more likely that you've been using a preexisting array or are inadvertently assigning to "main" from a function or your dotfiles or another location you haven't considered than that you've encountered a bug in zsh or zcurses.
Sure, it was just a thought. Yes, probably some crosstalk. I think I'll rename the array in any case. 'main' is not likely to be unique and besides one of the zcurses windows in named 'main' too. Very unsanitary. Esp. given zsh's indiscipline with variables. I know, all the shells are the same, but my C training makes me cringe at it to this day.