From 771274ff1a234d251bce1cd78e4afc92189eadb1 Mon Sep 17 00:00:00 2001 From: killian <63927363+KillianLucas@users.noreply.github.com> Date: Wed, 11 Oct 2023 23:19:20 -0700 Subject: [PATCH] Exits properly in colab --- interpreter/terminal_interface/terminal_interface.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/interpreter/terminal_interface/terminal_interface.py b/interpreter/terminal_interface/terminal_interface.py index 79019794a8..2f9230f331 100644 --- a/interpreter/terminal_interface/terminal_interface.py +++ b/interpreter/terminal_interface/terminal_interface.py @@ -163,8 +163,13 @@ def terminal_interface(interpreter, message): break except KeyboardInterrupt: - # Exit gracefully (this cancels LLM, returns to the interactive "> " input) + # Exit gracefully if active_block: active_block.end() active_block = None - continue \ No newline at end of file + + if interactive: + # (this cancels LLM, returns to the interactive "> " input) + continue + else: + break \ No newline at end of file