diff --git a/wharfee/client.py b/wharfee/client.py index bd7ea1b..22af142 100644 --- a/wharfee/client.py +++ b/wharfee/client.py @@ -1215,7 +1215,9 @@ def on_after_interactive(): # prompt is back to beginning of line self.is_refresh_containers = True self.is_refresh_running = True - return ['\rInteractive terminal is closed.'] + if is_interactive or is_tty: + return ['\rInteractive terminal is closed.'] + return [] def on_after_attach(): self.is_refresh_containers = True diff --git a/wharfee/main.py b/wharfee/main.py index 77bc71f..f6569f3 100644 --- a/wharfee/main.py +++ b/wharfee/main.py @@ -339,6 +339,9 @@ def run_cli(self): self.logger.error("traceback: %r", traceback.format_exc()) click.secho(str(ex), fg='red') + if '-i' in sys.argv or '-t' in sys.argv: + print('Interactive terminal is closed.') + self.revert_less_opts() self.write_config_file() print('Goodbye!') diff --git a/wharfee/options.py b/wharfee/options.py index e4c2e37..d002c81 100644 --- a/wharfee/options.py +++ b/wharfee/options.py @@ -743,6 +743,10 @@ def parse_command_options(cmd, params): if opt.default is not None: popts[opt.dest] = opt.default + # Check for interactive terminal options + if '-i' in params or '-t' in params: + print("Interactive terminal is closed.") + return parser, popts, pargs