Update tui.py to add application mode control when editing prompt

This commit is contained in:
Waylon Walker 2023-01-24 09:31:18 -06:00
parent 8b7e27d5c6
commit 0299d506be
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4

View file

@ -121,9 +121,11 @@ class StopwatchApp(App):
file = tempfile.NamedTemporaryFile(prefix="lockhart", suffix=".toml")
file.write(tomlkit.dumps(prompt).encode())
file.seek(0)
proc = subprocess.Popen([editor, file.name])
proc.wait()
self._driver.stop_application_mode()
with subprocess.Popen([editor, file.name]) as proc:
proc.wait()
self.refresh()
self._driver.start_application_mode()
def action_toggle(self):
try: