I thought about it some more, and the problem isn't detecting if the buffer changes, it's really detecting when a line is deleted from the front of the buffer to make room for a line at the end, so something like: on *:BufferDelete:window:{ } would suffice.