When running jhack tail and keyboard-interrupting the session without any events observed, live.stop() will
never be called, resulting in the terminal cursor state to get corrupted (cursor is hidden in shell).
Fix this by moving the call to live.stop() to the finally block, so that it will always be called.
The cause of this bug is that processor.quit() has an early exit that ended up never calling live.stop():
if not self._rendered:
self.live.update("No events caught.", refresh=True)
return
(alternatively, self.live.stop() could be called before the return in the if not self._rendered block)
The rich.live.Live object could be used as a context manager to avoid having to call .stop() explicitly, but for this fix I opted for a minimally-intrusive change. One could create a context manager scope with a Live object in _tail_events() and pass that into Processor's constructor (and move initialization of console and color out of it, most likely).
When running
jhack tail
and keyboard-interrupting the session without any events observed,live.stop()
will never be called, resulting in the terminal cursor state to get corrupted (cursor is hidden in shell).Fix this by moving the call to
live.stop()
to thefinally
block, so that it will always be called.The cause of this bug is that
processor.quit()
has an early exit that ended up never callinglive.stop()
:(alternatively,
self.live.stop()
could be called before thereturn
in theif not self._rendered
block)The
rich.live.Live
object could be used as a context manager to avoid having to call.stop()
explicitly, but for this fix I opted for a minimally-intrusive change. One could create a context manager scope with aLive
object in_tail_events()
and pass that intoProcessor
's constructor (and move initialization ofconsole
andcolor
out of it, most likely).