Detect user closing terminal window?

33 views
Skip to first unread message

Leather Dog Muksihs

unread,
Sep 18, 2020, 5:31:09 PM9/18/20
to lanterna-discuss
Is there a way to detect when a user closes the terminal windows so I can terminate a long running process?

Martin Berglund

unread,
Oct 4, 2020, 2:33:45 AM10/4/20
to lanterna...@googlegroups.com
Do you mean the SwingTerminalFrame? Yes, it will post an EOF "KeyStroke" event when the window is closed.

Regards,
Martin

Den lör 19 sep. 2020 kl 06:31 skrev Leather Dog Muksihs <muk...@gmail.com>:
Is there a way to detect when a user closes the terminal windows so I can terminate a long running process?

--
Det här meddelandet skickas till dig eftersom du prenumererar på gruppen "lanterna-discuss" i Google Grupper.
Om du vill sluta prenumerera på den här gruppen och inte längre få någon e-post från den skickar du ett e-postmeddelande till lanterna-discu...@googlegroups.com.
Om du vill visa den här diskussionen på webben besöker du https://groups.google.com/d/msgid/lanterna-discuss/0f7759f3-0d23-4944-a43a-0f218d9dfecan%40googlegroups.com.

David Balme

unread,
Oct 12, 2020, 8:54:17 AM10/12/20
to lanterna...@googlegroups.com
Are we talking about a real terminal? ie One that is the parent process of your java app?

If yes .. Why not just create a hook to the java shutdown handler?


Or are we talking about something else?

Cheers,
David


On Fri, Sep 18, 2020 at 5:31 PM Leather Dog Muksihs <muk...@gmail.com> wrote:
Is there a way to detect when a user closes the terminal windows so I can terminate a long running process?

--
Reply all
Reply to author
Forward
0 new messages