heh
heh copied to clipboard
Implement Crash Handling
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.