diff --git a/invokeai/backend/install/invokeai_configure.py b/invokeai/backend/install/invokeai_configure.py index 91f379a573..6873a6a426 100755 --- a/invokeai/backend/install/invokeai_configure.py +++ b/invokeai/backend/install/invokeai_configure.py @@ -629,7 +629,7 @@ def run_console_ui( # The third argument is needed in the Windows 11 environment to # launch a console window running this program. - set_min_terminal_size(MIN_COLS, MIN_LINES,'invokeai-configure') + set_min_terminal_size(MIN_COLS, MIN_LINES) # the install-models application spawns a subprocess to install # models, and will crash unless this is set before running. diff --git a/invokeai/frontend/install/model_install.py b/invokeai/frontend/install/model_install.py index 787da5724f..c4b19157a4 100644 --- a/invokeai/frontend/install/model_install.py +++ b/invokeai/frontend/install/model_install.py @@ -701,7 +701,7 @@ def select_and_download_models(opt: Namespace): # the third argument is needed in the Windows 11 environment in # order to launch and resize a console window running this program - set_min_terminal_size(MIN_COLS, MIN_LINES,'invokeai-model-install') + set_min_terminal_size(MIN_COLS, MIN_LINES) installApp = AddModelApplication(opt) try: installApp.run() diff --git a/invokeai/frontend/install/widgets.py b/invokeai/frontend/install/widgets.py index 9d75badb8d..82d3753eb4 100644 --- a/invokeai/frontend/install/widgets.py +++ b/invokeai/frontend/install/widgets.py @@ -17,18 +17,20 @@ from shutil import get_terminal_size from curses import BUTTON2_CLICKED,BUTTON3_CLICKED # minimum size for UIs -MIN_COLS = 130 +MIN_COLS = 136 MIN_LINES = 45 # ------------------------------------- -def set_terminal_size(columns: int, lines: int, launch_command: str=None): +def set_terminal_size(columns: int, lines: int): ts = get_terminal_size() width = max(columns,ts.columns) height = max(lines,ts.lines) OS = platform.uname().system if OS == "Windows": - _set_terminal_size_powershell(width,height) + pass + # not working reliably - ask user to adjust the window + #_set_terminal_size_powershell(width,height) elif OS in ["Darwin", "Linux"]: _set_terminal_size_unix(width,height) @@ -74,20 +76,14 @@ def _set_terminal_size_unix(width: int, height: int): sys.stdout.write("\x1b[8;{height};{width}t".format(height=height, width=width)) sys.stdout.flush() -def set_min_terminal_size(min_cols: int, min_lines: int, launch_command: str=None): +def set_min_terminal_size(min_cols: int, min_lines: int): # make sure there's enough room for the ui term_cols, term_lines = get_terminal_size() if term_cols >= min_cols and term_lines >= min_lines: return cols = max(term_cols, min_cols) lines = max(term_lines, min_lines) - set_terminal_size(cols, lines, launch_command) - - # did it work? - term_cols, term_lines = get_terminal_size() - if term_cols < cols or term_lines < lines: - print(f'This window is too small for optimal display. For best results please enlarge it.') - input('After resizing, press any key to continue...') + set_terminal_size(cols, lines) class IntSlider(npyscreen.Slider): def translate_value(self):