I can assure you my script isn't causing these issues, the only time it even uses /window is to /window -g2 $chan, for highlighting, which did not occur either times this bug has occurred.