Announcement

Collapse
No announcement yet.

Why does Kate open a new session for every file clicked in Dolphin?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] Why does Kate open a new session for every file clicked in Dolphin?

    In 19.04, if I clicked an editable file in Dolphin, it would re-use the existing Kate. Since, I keep Kate's "Documents" pane open, that's the way I wanted it. Now, after the update, it opens a new Kate session for every file clicked.

    If I look in the file-associations for text files, I see that the Kate configuration is the same as before: Kate -b %U . It's possible to force new Kate sessions with the "-n" flag, but Kate's man page doesn't give a way to force re-use of the existing session, although it's implied that "-b" will use an existing session if it can.

    Anybody know how to restore the old behaviour?

    #2
    Ah! Found the bug report:

    https://bugs.kde.org/show_bug.cgi?id=410742

    There's a fix applied to the source, so unfortunately there may be no work-around for the end-user. Somebody asked if it could be backported to Kate 19.04, but was told no, it's going into Kate 19.08. And that it seems was that.

    Edit: I see somebody's raised an Ubuntu bug, so I've added a comment to that:

    https://bugs.launchpad.net/ubuntu/+s...e/+bug/1849455
    Last edited by Dave Rove; Oct 23, 2019, 12:29 PM.

    Comment


      #3
      As a workaround, you could use a kate session. If you start kate with --start alice it will look for a session named "alice" and open the file in it, or start such a session.

      One way to exploit this would be a service menu, something like
      Code:
      [Desktop Entry]
      Type=Service
      ServiceTypes=KonqPopupMenu/Plugin
      MimeType=text/x-csrc;text/plain;
      Icon=text-x-generic
      Actions=edit;
      
      [Desktop Action edit]
      Name=edit with kate:alice
      Icon=text-x-generic
      Exec=kate --start alice "%F"
      I've put that in .local/share/kservices5/ServiceMenus/katealice.desktop, now if I right-click a .c file, in Actions there's an "edit with kate:alice" option. You'd have to add all the mime types you need to the MimeType line, separated with semi-colons.

      Or, in system settings, applications, file associations, choose a type you use kate with and select kate in the application preference order. Click Edit, and select the application tab. Edit the command to have "--start alice".
      Regards, John Little

      Comment


        #4
        Unfortunately, this bug breaks that option.

        I start Kate with a named session for file A. I then start Kate with the same name named session for file B. A second Kate window opens anyway containing both file A and file B. If file A in the first window had unsaved edits, then file A in the second window has the banner "This file was not closed properly".

        Looks like this bug not only breaks Kate's default session-sharing, but also breaks all the potential user-workarounds.

        Comment


          #5
          A fix just been released in the Kubuntu Updates PPA:
          https://launchpad.net/~kubuntu-ppa/+archive/ubuntu/ppa

          Comment


            #6
            Thanks. That works.

            Comment

            Working...
            X