a small improvement on all these examples could be looping through $comchan($me,N) instead of $chan(N). the former returns channels that you're actually on whereas the latter deals purely with the windows that are open. you might want to leave a channel window open that you're no longer in, maintain the window buffer for later review perhaps


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde