2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 01:22:00 +00:00

Update nodeconsole -w to work in arbitrary terminal programs.

This commit is contained in:
Andrew Wray 2022-11-01 11:29:41 -04:00
parent 3da2ac61cc
commit 8a3105cd51
2 changed files with 6 additions and 13 deletions

View File

@ -54,10 +54,8 @@ argparser.add_option('-w','--windowed', action='store_true', default=False,
'environment, to open a set of consoles for a range of '
'nodes in separate Windows Terminal windows, with the '
'title set for each node, set NODECONSOLE_WINDOWED_COMMAND'
' to "wt.exe --title node wsl.exe -d AlmaLinux-8 '
'--shell-type login". Note that "node" when in the '
'NODECONSOLE_WINDOWED_COMMAND environment variable is '
'treated as a keyword, not a literal.')
' to "wt.exe wsl.exe -d AlmaLinux-8 '
'--shell-type login".')
(options, args) = argparser.parse_args()
if len(args) != 1:
argparser.print_help()
@ -86,12 +84,9 @@ if options.windowed:
sys.stderr.write(res.get('error', repr(res)) + '\n')
sys.exit(1)
nodes.append(node)
# Hack to deal with messed up terminal after starting wt.exe using subprocess.Popen in WSL - AHW 10/15/22
sttyg = subprocess.run(['stty', '-g'], stdout=subprocess.PIPE, universal_newlines=True)
for node in sortutil.natural_sort(nodes):
subprocess.Popen(envlist + [confettypath, '-m', '5', 'start', '/nodes/{0}/console/session'.format(node)])
# Hack to deal with messed up terminal after starting wt.exe using subprocess.Popen in WSL - AHW 10/15/22
subprocess.run(['stty', '{0}'.format(sttyg.stdout.strip("\n"))])
with open(os.devnull, 'wb') as devnull:
subprocess.Popen(envlist + [confettypath, '-m', '5', 'start', '/nodes/{0}/console/session'.format(node)], stdin=devnull)
sys.exit(0)
#end of wcons
if options.tile:

View File

@ -43,10 +43,8 @@ a new session.
environment, to open a set of consoles for a range of
nodes in separate Windows Terminal windows, with the
title set for each node, set **NODECONSOLE_WINDOWED_COMMAND**
to `wt.exe --title node wsl.exe -d AlmaLinux-8
--shell-type login`. Note that **"node"** when in the
NODECONSOLE_WINDOWED_COMMAND environment variable is
treated as a keyword, not a literal.
to `wt.exe wsl.exe -d AlmaLinux-8
--shell-type login`.
## ESCAPE SEQUENCE COMMANDS