From e20e978e0400939ec0e6dbba0ba83b5a8646b98e Mon Sep 17 00:00:00 2001 From: Andrew Wray Date: Tue, 1 Nov 2022 13:25:20 -0400 Subject: [PATCH] Add xterm as default terminal for nodeconsole -w --- confluent_client/bin/nodeconsole | 12 +++++++----- confluent_client/doc/man/nodeconsole.ronn | 7 ++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/confluent_client/bin/nodeconsole b/confluent_client/bin/nodeconsole index 0479100f..d04b6e61 100755 --- a/confluent_client/bin/nodeconsole +++ b/confluent_client/bin/nodeconsole @@ -41,7 +41,7 @@ argparser.add_option('-l', '--log', action='store_true', default=False, argparser.add_option('-w','--windowed', action='store_true', default=False, help='Open terminal windows for each node. The ' 'environment variable NODECONSOLE_WINDOWED_COMMAND ' - 'must be set, which should be a text string corresponding ' + 'should be set, which should be a text string corresponding ' 'to a command that can be used to open a windowed console,' ' omitting the "nodeconsole " part of the ' 'command, for example, to open a set of consoles for a ' @@ -55,7 +55,9 @@ argparser.add_option('-w','--windowed', action='store_true', default=False, 'nodes in separate Windows Terminal windows, with the ' 'title set for each node, set NODECONSOLE_WINDOWED_COMMAND' ' to "wt.exe wsl.exe -d AlmaLinux-8 ' - '--shell-type login".') + '--shell-type login". If the NODECONSOLE_WINDOWED_COMMAND ' + 'environment variable isn\'t set, xterm will be used by' + 'default.') (options, args) = argparser.parse_args() if len(args) != 1: argparser.print_help() @@ -73,9 +75,9 @@ if options.log: if options.windowed: envstring=os.environ.get('NODECONSOLE_WINDOWED_COMMAND') if not envstring: - print("NODECONSOLE_WINDOWED_COMMAND not defined and -w specified. Exiting...\n") - sys.exit(1) - envlist=os.environ.get('NODECONSOLE_WINDOWED_COMMAND').split(' ') + envlist=["xterm", "-e"] + else: + envlist=os.environ.get('NODECONSOLE_WINDOWED_COMMAND').split(' ') nodes = [] sess = client.Command() for res in sess.read('/noderange/{0}/nodes/'.format(args[0])): diff --git a/confluent_client/doc/man/nodeconsole.ronn b/confluent_client/doc/man/nodeconsole.ronn index 22fc5ab4..c9246e7f 100644 --- a/confluent_client/doc/man/nodeconsole.ronn +++ b/confluent_client/doc/man/nodeconsole.ronn @@ -30,7 +30,7 @@ a new session. * `-w`, `--windowed`: Open terminal windows for each node. The environment variable **NODECONSOLE_WINDOWED_COMMAND** - must be set, which should be a text string corresponding + should be set, which should be a text string corresponding to a command that can be used to open a windowed console, omitting the `nodeconsole ` part of the command, for example, to open a set of consoles for a @@ -43,8 +43,9 @@ 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 wsl.exe -d AlmaLinux-8 - --shell-type login`. + to `wt.exe wsl.exe -d AlmaLinux-8 --shell-type login. If the + NODECONSOLE_WINDOWED_COMMAND environment variable isn't set, + xterm will be used bydefault. ## ESCAPE SEQUENCE COMMANDS