diff --git a/invokeai/frontend/install/widgets.py b/invokeai/frontend/install/widgets.py index 7044501e99..77d35bfb05 100644 --- a/invokeai/frontend/install/widgets.py +++ b/invokeai/frontend/install/widgets.py @@ -24,7 +24,16 @@ def set_terminal_size(columns: int, lines: int): OS = platform.uname().system if OS == "Windows": - _set_terminal_size_powershell(width,height) + # The new Windows Terminal doesn't resize, so we relaunch in a CMD window. + # Would prefer to use execvpe() here, but somehow it is not working properly + # in the Windows 10 environment. + if 'WT_SESSION' in os.environ: + args=['conhost'] + args.extend(sys.argv) + os.environ.pop('WT_SESSION') + os.execvp('conhost',args) + else: + _set_terminal_size_powershell(width,height) elif OS in ["Darwin", "Linux"]: _set_terminal_size_unix(width,height)