<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>445016</bug_id>
          
          <creation_ts>2021-11-05 13:50:52 +0000</creation_ts>
          <short_desc>Kate fails to save changes to the running session when it receives a SIGTERM</short_desc>
          <delta_ts>2022-03-02 18:41:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kate</product>
          <component>sessions</component>
          <version>Git</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nate Graham">nate</reporter>
          <assigned_to name="KWrite Developers">kwrite-bugs-null</assigned_to>
          <cc>christoph</cc>
    
    <cc>waqar.17a</cc>
          
          <cf_commitlink>https://invent.kde.org/utilities/kate/commit/a8a9eb10f4e9159504fd4c58c87bc755114c5b15</cf_commitlink>
          <cf_versionfixedin>22.04</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2075044</commentid>
    <comment_count>0</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-11-05 13:50:52 +0000</bug_when>
    <thetext>All KDE software built from source this morning on top of Fedora 34.


STEPS TO REPRODUCE
1. Open Kate with a session
2. Open a new file
3. `killall kate` (which sends the SIGTERM signal)
4. Launch Kate again

OBSERVED RESULT
Kate opens with the set of tabs that does not include the file opened in step 2. Changed session data is lost.

EXPECTED RESULT
Kate saves any changed session data (including newly-opened files) when it receives a SIGTERM signal.

IMPACT
Anytime Kate gets quit automatically by the user shutting down or restarting the computer, any changed session data is not saves, causing it to be lost. This is very annoying if the set of files opened in tabs differs significantly at the moment kate is SIGKILL&apos;ed from what it was when Kate was last launched.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2075045</commentid>
    <comment_count>1</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-11-05 13:51:22 +0000</bug_when>
    <thetext>(I mean SIGTERM&apos;ed)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2108851</commentid>
    <comment_count>2</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2022-03-02 06:23:34 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/649</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2108884</commentid>
    <comment_count>3</comment_count>
    <who name="Waqar Ahmed">waqar.17a</who>
    <bug_when>2022-03-02 11:16:44 +0000</bug_when>
    <thetext>Git commit a8a9eb10f4e9159504fd4c58c87bc755114c5b15 by Waqar Ahmed.
Committed on 02/03/2022 at 11:09.
Pushed by waqar into branch &apos;master&apos;.

Handle SIGINT/SIGTERM to prevent accidental data loss

(linux only)

M  +2    -0    kate/CMakeLists.txt
M  +16   -0    kate/main.cpp
M  +1    -0    shared/CMakeLists.txt
A  +101  -0    shared/signal_watcher.cpp     [License: LGPL(v2.0+)]
A  +37   -0    shared/signal_watcher.h     [License: LGPL(v2.0+)]

https://invent.kde.org/utilities/kate/commit/a8a9eb10f4e9159504fd4c58c87bc755114c5b15</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2108970</commentid>
    <comment_count>4</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-03-02 16:57:29 +0000</bug_when>
    <thetext>Thank you so much, Waqar!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2108987</commentid>
    <comment_count>5</comment_count>
    <who name="Christoph Cullmann">christoph</who>
    <bug_when>2022-03-02 18:41:24 +0000</bug_when>
    <thetext>Will be extended to KWrite in

https://invent.kde.org/utilities/kate/-/merge_requests/651</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>