System shutdown or SIGKILL will lose session data
If you kill the app with SIGKILL signal it will always loose all the state. That's the tl;dr info.
Example how do I reproduce it:
- Open NN
- In the terminal do:
top -b -n 1 | grep wrapand remember the pid (first number) - In the terminal do:
kill -9 INPUT_PID_HERE - You should be able to replace step 2 & 3 with
killall -9 AppRun.wrapped, but it seems that process name of NN is kind of generic and that could kill some other apps as well if you happen to run one with the same process name.
Originally posted by @dzek69 in https://github.com/dail8859/NotepadNext/issues/81#issuecomment-1381741141
I cannot reproduce this on Linux. I opened a session - and then killall -9 NotepadNext - when I re-open the app, the files are all OK (even the unsaved buffers).
@elcuco how do you run the app? on which distro? I'm on Linux Mint and when running appImage I don't have a process named NotepadNext therefore killall -9 NotepadNext just returns NotepadNext: no process found and Notepad continues to run
(sorry for late response)
Running the AppImage is broken here (Debian Testing, both Qt5 and Qt6 versions as pulled from a latest action run, which is another issue). So, I am unable to do the same test as you.
However - am running the process directly on Linux (from QtCreator, from the cmake branch to be precise) - and I cannot reproduce what you describe.
it must be something with the AppImage wrapper then
To verify run:
APPIMAGE_EXTRACT_AND_RUN=1 NO_CLEANUP=1 ./NotepadNext-x86_64.AppImage
Then look inside /tmp for your extracted image... and start digging into shell scripts:
diego@debian:/tmp/appimage_extracted_02dad8f10b1e395ca6df23ef954e0de4$ cat AppRun.wrapped
#! /usr/bin/env bash
# make sure errors in sourced scripts will cause this script to stop
set -e
this_dir="$(readlink -f "$(dirname "$0")")"
source "$this_dir"/apprun-hooks/"linuxdeploy-plugin-qt-hook.sh"
export APPIMAGE_APPLICATION_NAME=NotepadNext
exec "$this_dir"/AppRun.wrapped "$@"
Yap, the script just calles itself. I don't see any new commits here: https://github.com/AppImage/AppImageKit/commits/master nor here https://github.com/linuxdeploy/linuxdeploy-plugin-qt/commits/master - which makes the question ... more interesting.