From 3429173c278ca01208b6f96f60f85843d0c35a82 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 27 Mar 2020 10:57:14 -0400 Subject: [PATCH] nodeconsole changes to specifically target tmux tmux needs more direction to avoid ambiguous results. --- confluent_client/bin/nodeconsole | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/confluent_client/bin/nodeconsole b/confluent_client/bin/nodeconsole index 4f7d7b76..b52f0096 100755 --- a/confluent_client/bin/nodeconsole +++ b/confluent_client/bin/nodeconsole @@ -51,27 +51,28 @@ if options.tile: nodes.append(node) initial = True pane = 0 + sessname = 'nodeconsole_{0}'.format(os.getpid()) for node in sortutil.natural_sort(nodes): + panename = '{0}:{1}'.format(sessname, pane) if initial: initial = False subprocess.call( ['tmux', 'new-session', '-d', '-s', - 'nodeconsole_{0}'.format(os.getpid()), '-x', '800', '-y', + sessname, '-x', '800', '-y', '800', '{0} -m 5 start /nodes/{1}/console/session'.format( confettypath, node)]) else: - subprocess.call(['tmux', 'select-pane', '-t', str(pane)]) - subprocess.call(['tmux', 'set-option', 'pane-border-status', 'top'], stderr=null) - pane += 1 + subprocess.call(['tmux', 'select-pane', '-t', sessname]) + subprocess.call(['tmux', 'set-option', '-t', panename, 'pane-border-status', 'top'], stderr=null) subprocess.call( - ['tmux', 'split', '-h', + ['tmux', 'split', '-h', '-t', sessname, '{0} -m 5 start /nodes/{1}/console/session'.format( confettypath, node)]) - subprocess.call(['tmux', 'select-layout', 'tiled'], stdout=null) - subprocess.call(['tmux', 'select-pane', '-t', '0']) - subprocess.call(['tmux', 'set-option', 'pane-border-status', 'top'], stderr=null) - os.execlp('tmux', 'tmux', 'attach', '-t', 'nodeconsole_{0}'.format( - os.getpid())) + subprocess.call(['tmux', 'select-layout', '-t', sessname, 'tiled'], stdout=null) + pane += 1 + subprocess.call(['tmux', 'select-pane', '-t', sessname]) + subprocess.call(['tmux', 'set-option', '-t', panename, 'pane-border-status', 'top'], stderr=null) + os.execlp('tmux', 'tmux', 'attach', '-t', sessname) else: os.execl(confettypath, confettypath, 'start', '/nodes/{0}/console/session'.format(args[0]))