Skip to content

Commit

Permalink
fix curses bug when keyboardinterrupt
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Feb 18, 2024
1 parent 9efc5ad commit fe1e191
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cat_win/util/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,11 @@ def _open(self, write_func) -> None:
write_func (function):
a function to write a file
"""
self._init_screen()
self._run(write_func)
curses.endwin()
try:
self._init_screen()
self._run(write_func)
finally:
curses.endwin()

@classmethod
def open(cls, file: str, file_encoding: str, write_func, on_windows_os: bool,
Expand Down

0 comments on commit fe1e191

Please sign in to comment.