From 169fd976ce6dbe58e00527b25b27c6f77db839bf Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 6 Jun 2025 10:56:35 -0400 Subject: [PATCH] Compensate for out of sync resize behavior During the async vnc behavior, a copy of the geometry variables are used that are out of sync. Workaround by forcing a resize again after the async tasks conclude. --- confluent_client/bin/nodeconsole | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/confluent_client/bin/nodeconsole b/confluent_client/bin/nodeconsole index f8b41324..960c784c 100755 --- a/confluent_client/bin/nodeconsole +++ b/confluent_client/bin/nodeconsole @@ -404,8 +404,9 @@ def redraw(): else: sys.stdout.write('\n') sys.stdout.flush() - +resized = False def do_screenshot(): + global resized global numrows sess = client.Command() if options.tile: @@ -418,8 +419,11 @@ def do_screenshot(): for res in sess.read('/noderange/{}/nodes/'.format(args[0])): allnodes.append(res['item']['href'].replace('/', '')) numnodes += 1 + resized = False def do_resize(a=None, b=None): + global resized if a: + resized = True # on a window resize, clear the old stuff # ideally we'd retain the images and redraw them sys.stdout.write('\x1bc') @@ -474,6 +478,9 @@ def do_screenshot(): if url: urlbynode[node] = url draw_vnc_grabs(urlbynode, cwidth, cheight) + if resized: + do_resize(True) + resized = False elif vnconly: sys.stderr.write("Require asyncvnc installed to do VNC screenshotting\n") if options.interval is None: