Commit 0d65d0ea authored by AUTOMATIC1111's avatar AUTOMATIC1111
Browse files

add an option to not print stack traces on ctrl+c.

parent d4255506
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -150,9 +150,13 @@ def dumpstacks():

def configure_sigint_handler():
    # make the program just exit at ctrl+c without waiting for anything

    from modules import shared

    def sigint_handler(sig, frame):
        print(f'Interrupted with signal {sig} in {frame}')

        if shared.opts.dump_stacks_on_signal:
            dumpstacks()

        os._exit(0)
+1 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ options_templates.update(options_section(('system', "System"), {
    "list_hidden_files": OptionInfo(True, "Load models/files in hidden directories").info("directory is hidden if its name starts with \".\""),
    "disable_mmap_load_safetensors": OptionInfo(False, "Disable memmapping for loading .safetensors files.").info("fixes very slow loading speed in some cases"),
    "hide_ldm_prints": OptionInfo(True, "Prevent Stability-AI's ldm/sgm modules from printing noise to console."),
    "dump_stacks_on_signal": OptionInfo(False, "Print stack traces before exiting the program with ctrl+c."),
}))

options_templates.update(options_section(('API', "API"), {