kate does not load last-used session

Bug #774985 reported by brianzad1998tptagth
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
KDE Software Development Kit
Unknown
Unknown
kdesdk (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: kdesdk

1. $ lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04

2. $ apt-cache policy kate
kate:
  Installed: 4:4.6.2-0ubuntu1
  Candidate: 4:4.6.2-0ubuntu1
  Version table:
 *** 4:4.6.2-0ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/main amd64 Packages
        100 /var/lib/dpkg/status

3. What you expected to happen? I expected Kate to re-open the files I had left open in Kate when I closed Kate. So, I set the "Behavior on Application Startup" to "Load last-used session". So, if I had 2 text files in Kate when I closed it I expected Kate to automatically reopen those 2 files when I restart Kate.

4. What happened instead? When I start a new session of Kate it opens a new session. It didn't remember to reopen the files I had opened in it the last time I ran Kate.

5. Just in case it was my user profile being corrupt I created another user on my computer. Then logged out. Next I logged in as the other user. And tested Kate. I had the same problem. So, this affects all users.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: kate 4:4.6.2-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Sun May 1 12:33:30 2011
InstallationMedia: Kubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
ProcEnviron:
 LANGUAGE=
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: kdesdk
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , B-kde-bugs (b-kde-bugs) wrote :

Version: unspecified (using KDE 4.6.1)
OS: Linux

I installed kde 4.6.1 through the Kubuntu repositories on two completely different computers (one laptop and one desktop) and both have exactly the same effect. "Load last-used session" is selected, however when you close the window and reopen it, the session is either not saved upon close or not resumed upon reopen.

Reproducible: Always

Steps to Reproduce:
I have a feeling this doesn't affect other versions, but only kubuntu, so:
1) Install KDE 4.6 from ppa:kubuntu-ppa/backports
2) Select "Load last-used session" in the preferences
3) Open one or more files
4) Close and reopen kate

OS: Linux (i686) release 2.6.35-28-generic
Compiler: cc

Revision history for this message
In , Kde-bug-tracking (kde-bug-tracking) wrote :

Somehow I fixed the problem. I clicked on Sessions > Quick open session > default (which was the only option) and it loaded a session that was saved from before the kde 4.6 upgrade and now it works as expected.

Also, before this was fixed, I noticed that the "recent documents" were not saving either.

Hopefully this helps someone trying to debug this error.

Revision history for this message
brianzad1998tptagth (brianzad1998tptagth) wrote :
Revision history for this message
brianzad1998tptagth (brianzad1998tptagth) wrote :

This also happened in the distribution named PCLinuxOS KDE 2010.12 Desktop @ http://www.pclinuxos.com/?page_id=180

Revision history for this message
brianzad1998tptagth (brianzad1998tptagth) wrote :

note: It says Ubuntu but I'm using Kubuntu.

Revision history for this message
Ganton (ganton) wrote :

> I expected Kate to re-open the files I had left open in Kate when I closed Kate. So, I set the "Behavior on Application Startup" to
> "Load last-used session". So, if I had 2 text files in Kate when I closed it I expected Kate to automatically reopen those 2 files
> when I restart Kate.

In Kubuntu 11.10 it seems solved, at least it is solved on my computer, using a new installation.

Revision history for this message
Heath Matlock (heathmatlock) wrote :

Still present in 12.04, here's a video of Kate not using last-used and manual session options:
https://www.youtube.com/watch?v=kMnjdF1Eljc

:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise

Revision history for this message
Heath Matlock (heathmatlock) wrote :

:~$ kate --version
Qt: 4.8.1
KDE Development Platform: 4.8.2 (4.8.2)
Kate: 3.8.2

Revision history for this message
Heath Matlock (heathmatlock) wrote :

~/.kde/share/apps/kate/sessions/ doesn't have anything anything in the directory, removing ~/.kde/share/apps/kate/metainfos doesn't help (it was worth a shot, right? :) ) Removing ~/.kde/share/config/kate* and trying to get it working doesn't solve the problem either.

Revision history for this message
Heath Matlock (heathmatlock) wrote :

sudo dpkg-reconfigure kate didn't solve the problem

Revision history for this message
Heath Matlock (heathmatlock) wrote :

This is the only notification given while starting kate from the command line:
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.

Revision history for this message
Heath Matlock (heathmatlock) wrote :

Here's output from the command line with all the options selected in kdebugdialog:
 http://paste.kde.org/474446/
This is what you are seeing: I started kate and the session preferences were set to "manually choose a session", I opened ~/Documents/foobar.txt then went to session preferences and selected "load last-used session", clicked apply/ok, closed kate, and started kate from the command line again. It didn't use the session preferences as expected, and I closed the session.

Revision history for this message
brianzad1998tptagth (brianzad1998tptagth) wrote :

Still Present:
$ lsb_release -rd
Description: Ubuntu 12.04 LTS
Release: 12.04

$ apt-cache policy kate
kate:
  Installed: 4:4.8.2-0ubuntu2
  Candidate: 4:4.8.2-0ubuntu2
  Version table:
 *** 4:4.8.2-0ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

$ kate --version
Qt: 4.8.1
KDE Development Platform: 4.8.2 (4.8.2)
Kate: 3.8.2

$ kate
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.

Revision history for this message
brianzad1998tptagth (brianzad1998tptagth) wrote :

found fix at: http://askubuntu.com/questions/57855/how-do-i-get-kate-to-restore-last-used-session

Below is an excerpt (showing section [General]) of my old "/home/brian/.kde/share/config/katerc" file that didn't save sessions followed by the modified "/home/brian/.kde/share/config/katerc" that is working and seems to be saving my sessions.

Old File:
[General]
Days Meta Infos=30
Last Session=
Modified Notification=false
Restore Window Configuration=true
Save Meta Infos=true
Show Full Path in Title=false
Show Status Bar=true
Startup Session=last

New File:
[General]
Days Meta Infos=30
Last Session=mysession.katesession
Modified Notification=false
Restore Window Configuration=true
Save Meta Infos=true
Show Full Path in Title=false
Show Status Bar=true
Startup Session=last

Changed in kdesdk (Ubuntu):
status: New → Opinion
status: Opinion → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kdesdk (Ubuntu):
status: New → Confirmed
Revision history for this message
In , Cullmann-t (cullmann-t) wrote :

If that works for you now, that is fine, I guess we won't find there any error, as we can't reproduce, too.

Revision history for this message
In , B-kde-bugs (b-kde-bugs) wrote :

This bug actually still exists for me even after OS reinstall. When telling kate to remember the last session, the "Last Session" variable of ~/.kde/share/config/katerc should change from blank to "mysession.katesession", but this doesn't happen, so when you open up kate, it always starts with a new window. I tried manually editing the above file with that value, but upon one of the updates it got overwritten again.

See the following question I opened on askubuntu: http://askubuntu.com/questions/57855/how-do-i-get-kate-to-restore-last-used-session

Another way to reproduce this bug:

1) In ~/.kde/share/config/katerc change the Last Session line to "Last Session=" with nothing after it
2) Open Kate and set it to remember "load last-used session" (if it isn't already)
3) Open a file with Kate and close and reopen the window

Revision history for this message
Roland Hughes (original-seasoned-geek) wrote :

The fix isn't working for me. It seems to be part of the problem, but not the entire problem. If you start kate, open 3 files, do not edit the content of those files, then exit kate and restart, kate does not load those files.

Revision history for this message
kodx (kodx) wrote :

Kubuntu 12.10 with KDE 4.10 backports installed, bug still there.

Revision history for this message
kodx (kodx) wrote :

I found how to fix this.
First call "Save session as"
Next choose in General->Sessions "Load last session"

Revision history for this message
Rael Gugelmin Cunha (rael-gc) wrote :

This come back to me about one time in a week.

To fix, I always have to open the ~/.kde/share/config/katerc and put back the following value for LastSession:

Last Session=mysession.katesession

Then, for some reason, sometimes the Last Session value get blank again, and Kate do not restore the previous session.

Revision history for this message
Rael Gugelmin Cunha (rael-gc) wrote :

And Yes, I have the "Load Last Session" checkbox checked. Using 4.10 backports with Kubuntu 12.04 LTS.

Revision history for this message
Mike Robinson (launchpad-multiwebinc) wrote :

I can't believe this doesn't affect more people. It happens to me on every single kubuntu install I have ever done right out of the box. I also tried the fix suggested on askubuntu.com and it worked for a while and then somehow reverted itself, as Rael mentions. When you choose the option to load the last session, it should automatically create all the necessary entries in ~/.kde/share/config/katerc if they are not present. It seems like it should be pretty trivial to fix this.

Revision history for this message
kodx (kodx) wrote :

This bug there is about 2 years now.
I came to solution - not to use kde and all of it's software. It is completely buggy and nothing gonna change in near future.
I recommend to look at emacs or sublime text as a replacement for kate.

Revision history for this message
Paul White (paulw2u) wrote :

@kodx, your comment does nothing to help solve whatever problems you may be having with kate.

I've been using kate since Kubuntu 11.04 and have always found that kate does use the last-used session if told to do so.

I've marked this bug as "not affecting me". Recommending a switch to emacs does not help.

Is this bug registered in the KDE bug tracker? That is where upstream bugs should be logged and then linked here.

no longer affects: kate (Ubuntu)
Paul White (paulw2u)
tags: added: kubuntu precise
tags: added: quantal
Changed in kdesdk:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
In , Michal-humpula (michal-humpula) wrote :

Hi Mike,

do you still experie this problem with current version of kate?

Revision history for this message
In , B-kde-bugs (b-kde-bugs) wrote :

Yes, I am still having the same problem with Kubuntu 13.10: KDE 4.11.3 and Kate 3.11.3.

Revision history for this message
In , Michal-humpula (michal-humpula) wrote :

Hi Mike,

the session workflow changed a little bit trough time (there is no explicit default session now). I've noticed that you don't select any session specificaly in your "steps to reproduce". If you just start kate to new session, open files and then quit kate, the last session will be none, i.e. the new (unnamed) session doesn't count in this case. You have to quit kate with named/saved session.

Is this the case you are describing?

Revision history for this message
In , B-kde-bugs (b-kde-bugs) wrote :

Hi Michal,

Thank you for your reply. I think Kate is a bit misleading then. If I tell my web browser to resume the last used session, it opens up my previous tabs. If I tell KDE to restore my previous session (Settings > Session Management), it opens up my previously used windows when I log in again. I would expect that when Kate says "Load last-used session", it would open up all the previous files that were open when Kate was closed.

However, if the desired behavior is to have the user first create a session and then save it and only then can it be resumed, perhaps some sort of error message should appear when the "last-used" session is not available.

Revision history for this message
brianzad1998tptagth (brianzad1998tptagth) wrote :

Hello,

After giving up on this I tried troubleshooting again and found that the fix I noted above is working now.

This was using the same fix shown above by editing the "katerc" file in section named [General] and adding,
Last Session=mysession.katesession

My notes:
$ kate --version
Qt: 4.8.4
KDE Development Platform: 4.11.5
Kate: 3.11.5

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 13.10
Release: 13.10
Codename: saucy

Revision history for this message
brianzad1998tptagth (brianzad1998tptagth) wrote :

of course, your mileage may vary.

Revision history for this message
ktp (kari-petersen) wrote :
Download full text (6.2 KiB)

I had the same problem with kate not saving session. It seems to be filesystem permission related. At least it works now for me.

Have a look at the owner of the folder ~/.kde/share/apps/kate/, which in my case was owned by root:root. Starting kate from the commandline lead me to the problem, because it complained about not beeing able to access some subfolders there.

johndoe@laptop:~$ kate --version
Qt: 4.8.6
KDE: 4.13.3
Kate: 3.13.3
johndoe@laptop:~$ kate
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
trying to create local folder /home/johndoe/.kde/share/apps/kate/sessions: Keine Berechtigung
trying to create local folder /home/johndoe/.kde/share/apps/kate/plugins: Keine Berechtigung
trying to create local folder /home/johndoe/.kde/share/apps/kate/plugins: Keine Berechtigung
trying to create local folder /home/johndoe/.kde/share/apps/kate/plugins: Keine Berechtigung
trying to create local folder /home/johndoe/.kde/share/apps/kate/plugins: Keine Berechtigung
Bus::open: Can not get ibus-daemon's address.
IBusInputContext::createInputContext: no connection to ibus-daemon
^C
johndoe@laptop:~$ cd .kde/share/apps/
johndoe@laptop:~/.kde/share/apps$ ls -la
insgesamt 180
drwxr-xr-x 45 johndoe johndoe 4096 Aug 19 16:34 .
drwxr-xr-x 6 johndoe johndoe 4096 Mai 21 17:43 ..
drwx------ 4 johndoe johndoe 4096 Mai 21 17:43 activitymanager
drwx------ 3 johndoe johndoe 4096 Mai 21 17:29 akonadi_migration_agent
drwx------ 7 johndoe johndoe 4096 Aug 28 17:45 amarok
drwx------ 4 johndoe johndoe 4096 Mai 21 17:43 desktoptheme
drwx------ 3 johndoe johndoe 4096 Mai 22 13:37 dolphin
drwx------ 3 johndoe johndoe 4096 Mai 24 13:09 gwenview
drwx------ 2 johndoe johndoe 4096 Mai 24 07:16 k3b
drwx------ 2 johndoe johndoe 4096 Mai 21 17:43 kabc
drwx------ 2 johndoe johndoe 4096 Jun 15 20:06 kaffeine
drwx------ 4 root root 4096 Mai 21 18:37 kate
drwx------ 2 johndoe johndoe 4096 Jul 15 10:26 katepart
drwx------ 3 johndoe johndoe 4096 Mai 21 17:43 kconf_update
drwx------ 2 johndoe johndoe 4096 Jun 18 00:27 kcookiejar
drwx------ 3 johndoe johndoe 4096 Mai 21 17:43 kded
drwx------ 2 johndoe johndoe 4096 Sep 2 10:33 kfileplaces
drwx------ 3 johndoe johndoe 4096 Jul 24 15:32 khelpcenter
drwx------ 2 johndoe johndoe 4096 Sep 1 20:01 klipper ...

Read more...

Revision history for this message
Paul White (paulw2u) wrote :

Seems to be a misunderstanding of how sessions work.
Marking as incomplete for now.

Changed in kdesdk (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
ilker (ilkerk) wrote :

I think there are some misunderstanding in the offered workarounds above however the issue/bug is clear and still exists.

To replicate the issue :
After a fresh install, under configuration->sessions choose "Load last used session".
Open A.txt, close kate, reopen kate. Observe that A.txt is not opened.

I think Kate supports two use cases, one is working with sessions : you can save open load sessions etc... This mode is working fine.

Another use case is working without any session (or unnamed session if you prefer). This seems like it is the default mode. This issue is related to that. When you choose working without any session then you enjoy global recent files menu (as some users prefer) and you supposed to have a single session.

A workaround is create a session say MyFixedSession,
then update the kate.desktop file with

Exec=kate -b --s MyFixedSession %U

P.S. If you run "kate somefile.txt" from the terminal it will start a new session. So you might need to use "kate --s MyFixedSession somefile.txt"

best,

Revision history for this message
In , Andrew-crouthamel (andrew-crouthamel) wrote :

Hi from the Bugsquad!

I am going to change this severity to wishlist since the reporter can make this function, but has to create a session first. I can confirm the session loading works, but agree it is confusing.

Changed in kdesdk:
importance: Medium → Wishlist
Revision history for this message
brianzad1998tptagth (brianzad1998tptagth) wrote :

Yes, it is confusing. But, maybe not confusing for developers.

Revision history for this message
brianzad1998tptagth (brianzad1998tptagth) wrote :

I only just went back to KDE after KDE 3.5.

Revision history for this message
In , Kde-7 (kde-7) wrote :

This is a bug, and not a wish!
I came here today because I wanted to file a bug about exactly this totally unexpected behavior of Kate and first searched if it is already reported. It is reported 5 times, exactly this or a closely related bad behavior, the first reports dating back to the year 2011 and 2013. Calling it a wish because someone might by chance find some hidden workaround is not helpful for the user. The repeated reports clearly show this. Classifying it a wish might be good to fake the statistics about KDE software related bugs to look better, though. But calling it a wish does not resolve the bad behavior and only pushes it deeper into the state of "will never be cared for". As you can read, upon reading the last comment, my mood changed from "Hmmm, I should spent some time to write a helpful bug report" to "I like KDE PLASMA and will continue to use it, but it might be better to not expect the KDE applications to receive support and before even loosing time to write a bug report simply stay with other solutions, like in this case Geany". However, as I have the other report numbers already at hand, here they are:
https://bugs.kde.org/show_bug.cgi?id=268913 (this one, from 2011!)
https://bugs.kde.org/show_bug.cgi?id=319396 (from 2013)
https://bugs.kde.org/show_bug.cgi?id=342057 (from 2014)
https://bugs.kde.org/show_bug.cgi?id=332949 (from 2014)
https://bugs.kde.org/show_bug.cgi?id=382906 (from 2017)
I wanted to write all this from those 5 reports in my own bug report, but as all this is already reported, I should not do so. Now I am unsure. Maybe I have to report it as a new bug, so that after so many years this strange and not expected behavior once might receive attention.
I am using on Debian 9.5 (currently the stable Debian edition):
Kate 16.08.3
KDE Frameworks 5.28.0
Qt 5.7.1 (built against 5.7.1)
The xcb windowing system

*** This bug has been marked as a duplicate of bug 319396 ***

Changed in kdesdk:
status: New → Confirmed
Revision history for this message
brianzad1998tptagth (brianzad1998tptagth) wrote :

I would guess KDE does not want to bother.

Kate is much too complex a software program for the likes of me. I will stick to tcpdump and Kate's replacement, FeatherPad.

Revision history for this message
brianzad1998tptagth (brianzad1998tptagth) wrote :

I think this resolves the issue.

See, Plasma secrets: save session in Kate, (Updated: November 21, 2018), written by, dedoimedo
https://www.dedoimedo.com/computers/plasma-kate-save-session.html

Revision history for this message
Roger (williandmn) wrote :

> I think this resolves the issue.
>
> See, Plasma secrets: save session in Kate, (Updated: November 21, 2018), written by, dedoimedo
> https://www.dedoimedo.com/computers/plasma-kate-save-session.html

I just stumbled across this bug (again).
Apart from kate's misleading behavior, the directory ./local/share/kate (and ./local/share/kate/sessions) was somehow owned by root, preventing me from effectively saving any session.
Just to remind anyone else in the same situation to check that those permissions are correct, otherwise the workaround above won't work.

Revision history for this message
Paul White (paulw2u) wrote :

Upstream bug #268913 has been marked as a duplicate of #319396
which has been closed "RESOLVED FIXED" in version 19.04.0
so changing upstream link to reflect how KDE developers are
resolving the issue.

Unsubscribing as I'm no longer a KDE user and reverting Ubuntu
task to "Confirmed". Someone should update to show the issue
fixed when happy with KDE's update.

Changed in kdesdk:
importance: Wishlist → Unknown
status: Confirmed → Unknown
Changed in kdesdk (Ubuntu):
status: Incomplete → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.