heh icon indicating copy to clipboard operation
heh copied to clipboard

Implement Crash Handling

Open ndd7xv opened this issue 2 years ago • 0 comments

Background

If you run something like

kill <heh pid> # which you can probably get with $(ps -ef | grep heh | grep -v grep | awk '{print $2}')

heh will terminate and fail to save any progress or changes made. It will also remain with raw mode enabled, rendering the terminal session extremely difficult to use.

Task

When running the command mentioned above, heh should have some sort of graceful way of preventing data loss, or at least a way to alert the user and leave the terminal session usable. Doing the same thing for vim prints out

Vim: Caught deadly signal TERM
Vim: preserving files...
Vim: Finished.

For saving things, we could try using .swp files.

ndd7xv avatar Sep 11 '22 18:09 ndd7xv