From af1659dafde5a1f7c2a646f5b1e5fca2819ba615 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 23 Apr 2025 09:44:10 -0400 Subject: [PATCH] Have nodeconsole exit below screenshots --- confluent_client/bin/nodeconsole | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/confluent_client/bin/nodeconsole b/confluent_client/bin/nodeconsole index 86faa68b..176e815e 100755 --- a/confluent_client/bin/nodeconsole +++ b/confluent_client/bin/nodeconsole @@ -313,9 +313,9 @@ def reset_cursor(node): cursor_left(currcolcell) cursor_up(currrowcell + 1) - nodepositions = {} -if options.screenshot: +def do_screenshot(): + global numrows cwidth = None cheight = None sess = client.Command() @@ -381,6 +381,15 @@ if options.screenshot: time.sleep(options.interval) sys.exit(0) +if options.screenshot: + try: + do_screenshot() + except KeyboardInterrupt: + pass + finally: + cursor_down(numrows) + sys.stdout.write('\n') + sys.exit(0) def kill(noderange): sess = client.Command() envstring=os.environ.get('NODECONSOLE_WINDOWED_COMMAND')