tree 9ee1d06da25600ce81f74e6f729f781d6e6092b7 parent 81a457e6fb169141fe567feb7bf70f98a8ad6c2a author Nicholas Marriott 1251935365 +0000 committer Nicholas Marriott 1251935365 +0000 Fix a race condition when asking a client to take over the terminal (switching to a different poll loop): If a MSG_READY was followed very quickly by a MSG_EXIT (for example if doing "tmux new 'exit'"), both messages could be read as part of the same imsg_read in the first client poll loop. The MSG_READY would then cause a switch to the second client loop, which would immediately call poll(2) again, causing the client to hang forever waiting for an exit message that it already had. Change to call imsg_get to process any existing messages before polling.