Konqueror session management + crash handler

So as it was promised, konqueror session management is already done. I’ve just sent an email to kfm-devel with the patch attached and hopefully the patch will enter into trunk before the hard feature freeze (next monday) so that we get it in Konqueror 4.1.

The session management support is pretty similar to the one that Opera has. Let’s say it’s inspired in Opera =). And as everyone likes screenshots, here there is one that shows the new menus for session management:

So you can easily save current session, open one of the saved sessions, or manage current sessions. And only one more item was added to the File Menu, which is the same menu where session management resides in Opera.

The Manage sessions dialog lets you save current session in a new session or in an existing session (overwriting it). It also can rename an existing session, or delete it. Or even open one of those sessions. Quite straightforward if you look at it, actually:

And I have reserved the best part for the end. Proper crash session recovery! Because Konqueror shouldn’t, but it can crash sometimes. And it crashes even more when you use KDE trunk. Until now, the only option you had to recover from a crash was using the crash plugin which is sub-optimal.

What I’ve done is something similar to what Opera, Firefox and many others browsers do: Save session every X seconds (it’s configurable via konquerorrc, 10 seconds by default as in firefox). This is done for all konqueror processes, and it’s saved in ~/.kde/share/apps/konqueror/autosaved/. Each process saves its session timely there in a file with a name similar to “:1.114” which identifies it. When a konqueror instance is closed cleanly, its file is removed.

Thus, every time a new window or konqueror process is launched, Konqueror reads that directory and asks to DBus if there’s any service registered with the name “:1.114”, for example, or whatever name have the autosaved files. This is done very fast, because no text parsing or waiting is needed, so the user doesn’t feel any delay.

If for some reason there’s a file with a name that is not related to a registered dbus service, that means that something wrong happened i.e. a konqueror process crashed or froze. And in that case, you get this nice dialog:

Which allows you to restore session if you want, or not, or even not restoring it now but restoring it later (opening a new konqueror process / window). As David Faure suggested me, it also allows you to check “do not ask again” and always do whatever you choose automatically without asking everytime. Nice isn’t it?

There’ still some related fixes I want to add to SVN before hard feature freeze, like adding a KAction menu to “Hibernate konqueror”, i.e. Save current session and close konqueror, so that next time you open konqueror it can be restored. Also listing the crashed and still not restored sessions (i.e. you clicked in “ask me later”) in the sessions menu.

Oh and adding an option to undo closed tab to right click menu of the konqueror tabbar is a must too, I use that option a lot now in firefox and we need it too ;-).


35 Responses to “Konqueror session management + crash handler”

  1. 1 dumas65 mayo 16, 2008 de 10:16 am

    Cool news. I like konqueror. But this is most wanted features.
    I’m waiting “Hibernate konqueror” function. The best thing I like about opera is that i can close it and after opening browser shoes same tabs.

  2. 2 fyanardi mayo 16, 2008 de 10:20 am

    Cool! A long awaited feature for Konqueror, thanks for your great work! When it will be committed to trunk?

  3. 3 Jakob Petsovits mayo 16, 2008 de 10:32 am

    Whoo, that’s nice! Yay for crash recovery, thanks a lot for that feature 😀

    However, can I propose a few small interface changes?

    * My pet peeve, icons: Please don’t use icons just because you can, but only where they make sense. Particularly, the button icons in the crash recovery dialog (“Restore session”, “Do not restore”, “Ask me later”) make little sense because the user can’t quickly associate the actions with those icons, and worse, the way you use the icons there is *slightly* different to what they normally mean. That’s confusing, and it would be better not to have any icons on the buttons there. Also, please use the “edit-rename” icon for the “Rename” button in the session management dialog instead of “document-save-as”, don’t use an icon for the “Sessions” sub-menu as there’s no appropriate icon for that, and don’t use the “folder” icon for the sessions in the management dialog if they all use the same icon – it doesn’t convey additional information.

    * It would be neat to have a consistent sessions interface between Konqueror and the existing Kate sessions menu structure. That would include renaming “Manage sessions…” to “Manage…”, “Save this session…” to “Save As…”, and introducing a “Save” action that saves the currently opened session without asking for its name. (Alternatively, you could talk to the Kate team to adapt their Sessions menu to your structure… but whatever the outcome, it should be consistent throughout KDE.)

    * For the long term, we should ask ourselves how the new sessions feature interacts with the already existing”View Profiles” feature in the Sessiongs menu. I would assume that it’s difficult for the user to tell the difference between those two, especially since both can save URLs as well. I think it’s probably confusing if not unnecessary to keep both of them – maybe you can merge those two into one “Session” feature? I also find it awkward to have one of those in the “File” menu while the other one is in “Settings”, that should really be worked out. Perhaps introduce a separate “Sessions” menu like the one from Kate, and put both Sessions and View Profiles there until they are merged? Please bring this up with the Konqueror devs.

  4. 4 Joshua mayo 16, 2008 de 10:35 am

    Didn’t this already exist in konqueror (other than the crash handling, which is insanely welcome) in the form of view profiles?

  5. 5 Emilsedgh mayo 16, 2008 de 10:46 am

    @Joshua: View profiles are for konqueror settings, like toolbars and menus and such, but Sessions are just for websites and tabs opened by Konqueror.

    actually i think Konqueror’s menu’s are becoming a mess.I dont know how your Konqueror’s “Files” menu is that clean, but i have hundreds of ‘Open with foo’ items there and other menu items are becoming a mess too.
    Window menu is bloated too.items at there should probably go into submenus.
    Also ‘Bookmarks’ menu could be a sub-menu in ‘Tools’ menu.

    one other thing is ‘View profiles’.is this thing really usefull? i havent seen anyone using it, so it would be nice if konqueror devs remove it (if it is not really used).

  6. 6 Henrik Pauli mayo 16, 2008 de 10:52 am

    Watch the “:” in those file names — Win32 won’t like them 🙂

  7. 7 Joshua mayo 16, 2008 de 11:31 am

    @Emilsedgh: That may be what they are for, but with the little “Save URLs in profile” checkbox, it amounts to pretty much the same thing.

    Even if you weren’t able to do that, the view profiles allow you to set konqueror up differently for different tasks. I can set it to have a multi-pane view for file management (I like having both time and name sorted panes locked onto the same URL so as I move through the filesystem the panes always show the same folder) while have my web browsing interface be as simple as only having a location bar and the rest of the window just be used for the web page (no navigation buttons or oter toolbars to take up space). Without the view profiles I would have to stick with just one or the other.

  8. 8 Zayed mayo 16, 2008 de 11:43 am

    Thank you.

    Maybe this is not related to konq. only, I do not like how to navigate tabs.

  9. 9 edulix mayo 16, 2008 de 11:59 am

    icons: I like icons, I want icons. For example in the restore session dialog, I like the red X button for “Do not restore” because it kind of warns me “hey, be careful you will loose the saved session”. The chronometer for aks me later kind of tells you “sometime you will be asked again”. And the “Restore session” has a “window-new” icon, which is related, because it will open a new window indeed.
    That doesn’t mean you’re not right: I probably should ask for a “ask-later” icon, for example, and let the icon people deal with how should it look like =)
    About the edit-rename, and removing sessions’ icons in the menu and in the Session management dialog, take it for granted I will fix it.

    consistent interface: I’ve just changed my code to use the same strings as Kate =) I don’t like Kate’s menu structure, too verbose.. I prefer the one I created which resembles opera’s. I definitely don’t want having a new top-level Sessions menu for one, etc. After all sessions is not as important in konqueror as in Kate so I want to keep it as simple as it gets for now.

    view profiles: it’s not same thing as someone already pointed And they are in different places because of that. In fact, when you save a session the current konqueror profile is saved with it, so that it can be restored. And saving a session includes caching the pages and saving back-forwards history and even form-data, meanwhile saving the profile doesn’t only saves the URLs.

    Konqueror menu’s are a mess and that *must* be dealt with soon. All those open With items should probably be in a sub-menu. And the View profiles menus should probably copy the menu-arrangement of the sessions menu i.e. one submenu with all the options. KISS.
    But no, I’d definitely not put bookmarks under “Tools” menu, and it should keep being top level or enter inside the “Go” menu when the location bar can search inside bookmarks & history and thus the bookmarks menu is not so highly needed.

    Thanks for all the feedback!

  10. 10 xdmx mayo 16, 2008 de 12:43 pm

    about the undo close, would be better “undo close tab” and “closed tabs list”, as firefox… so you can choose to reopen one of the last N closed tabs 🙂

  11. 11 Will Stephenson mayo 16, 2008 de 12:54 pm

    I guess you don’t start the save session timer again after a save, until the session contents change, right? This will save battery.

  12. 12 edulix mayo 16, 2008 de 3:12 pm

    You already have a undo closed item and undo closed items in Konqueror. What I mean is adding a shortcut in the contextual menu of the tab bar for “undo last closed tab” as in Firefox.

    Too much complicated, not really feasible. Session state changes even when you type in a form or scrolls in a page. I implement it the straightforward way: every X (X = 10seconds by default) seconds, sessions is saved. That’s how it’s done elsewhere and it works fine: kmail, Opera, Firefox..

  13. 13 Serhiy Kachanuk mayo 16, 2008 de 3:13 pm

    Will this seesion saving be used when saving desktop session on exit? Would be weary handy, in KDE3 it doesn’t save back-forward history etc.

  14. 14 Sebastian Sauer mayo 16, 2008 de 4:21 pm

    Thank you very much for that! Time to recompile 🙂

  15. 15 xdmx mayo 16, 2008 de 5:16 pm

    i’m still using kde 3.5.8, so i don’t know if there is already this or not, btw i meant something like this: http://img403.imageshack.us/img403/402/32af8.jpg
    A nice one is also the undo with the middle mouse button, it’s quite useful 🙂

  16. 16 Jeff mayo 16, 2008 de 6:25 pm

    Thank you! Opera was my baby until they forgot how to make Flash work under Linux, then I moved to Konqueror. I love the tight integration and low overhead of it, but I dearly missed features like these from Opera.

  17. 17 arekm mayo 16, 2008 de 8:42 pm

    btw. Is konqueror 4.1 webkit based? I remember seeing some information that this will be case but it’s silent from that time.

  18. 18 stefan mayo 16, 2008 de 9:17 pm

    @arekm: As far as I know, KHTML is still default. Some distributors (e.g. openSUSE) already offer a webkitpart package. The Webkit KPart can then be activated in systemsettings, at “Advanced > File Associations”: Select text/html at the left, and change the position of webkitpart in the “Embed” tab.

  19. 19 edulix mayo 17, 2008 de 12:33 am

    @Sebastian Sauer
    Note that the patch has not yet landed into trunk, although you can get it from kfm-devel.

    @Serhiy Kachanuk
    Yes, that’s already working in KDE 4.0.0 and newer versions 😉

    Uhm I will take a look at that, I like having small contextual menus though.

  20. 20 Forrest mayo 17, 2008 de 10:32 am

    When I’m asked a question like “Do you want to restore everything you had open when the program crashed?”, my answer is always the same: “I don’t know. What did I have open?”

    Show us a list, please.

  21. 21 edulix mayo 17, 2008 de 11:37 am

    Really interesting idea. I’m taking Google Browser Sync as a reference http://www.google.com/tools/firefox/browsersync/index.html

  22. 22 Zarantu mayo 18, 2008 de 3:10 am


    This is a great feature thats been needed for a long time,
    Thank You.

    I’ve got a couple thoughts to add:
    > First, as (Forrest) suggests “Show us a list, please”,
    if a session with multiple tabs crashes, you should be able
    to edit/select the tab/URLs to be restored (for those rare
    cases when just one URL continues to crash), show them as a
    list with “Select All/None” button, and check box for each,
    and maybe an “Open in New Session” button for each URL,
    also would be nice to have an option to Bookmark all or each
    URL when Restoring, or have a auto-generated list of the URLs
    in the Side-Bar like the History tab.

    > Second, perhaps the entire “Session Management” feature could
    become a desktop-wide service for any app to utilize, integrated
    with the “Crash Handler”, providing the Session Management as a
    standard component for the whole Desktop session, to every
    individual app that wants to use it, then when something does
    crash, at any level, the “Crash Handler” would not only alert
    the user about the problem, but offer to Restore there app to the
    last auto-saved state.

    > Third, the “Profile Manager” is an Absolutly Essential feature,
    I use it constantly, and think its one of those great features
    that gets overlooked, However it could use another config option
    wether or or not to (when there is only one tab/URL open):
    1> save with the current URL
    2> (when overwriting an already saved profile) save the previous
    3> save with the default URL (about:/).

    > I’ve want to say this for awhile, when I was trying out the
    OpenSuSE+KDE-4.0.0 several months ago, I noticed that when I
    saved a file, all the Spaces were automaticly converted to
    Underscores, YES!! (Thank You 10 Million Fold, who ever did
    that!!) now just auto-convert those Other annoying characters
    that bork shell scripts ie: `~!@#$%^&*()=|\{}[]:;”‘,?/ into
    the few that don’t ie: -_+. that would be wonderfull.

    > Woud it be possible to fix the “Web Archiver” so that when
    opening archived pages they did not prompt for Cookies, and
    Broken PHP/Java/etc.. Scripts, and most especially, not attempt
    to load the Evil that are Advertisement’s, Please ?!?
    (those nasties make .war files a pain, especially as Previews)
    Also, ensuring that the web archiver does not get forgotten
    or removed, as I have well over 100,000. (with 8995 currently
    on disk).

    > Last, an optional “URI Selector” pull down menu prefixed to the
    URL field, that list all supported URI’s, especially the KDE
    specific ones like “fish://”, and when selected automatically load
    it’s about, overview, or man page.


  23. 23 Joergen Ramskov mayo 20, 2008 de 10:21 am

    That’s really cool and it’s something I’ve really miss. It is one of the major reasons why I use Firefox.

    My pet peeve: CTRL-L (going to the URL bar) clears the URL bar. I much prefer the way Firefox and other browsers does it. Just mark the entire url, then when I start typing, the current url gets replaced, but it also gives me the option to copy the current URL. I find that I use that feature often.

  24. 24 Stefan marzo 5, 2010 de 11:21 pm

    I generally welcome session management.
    But I have a problem with automatic session restoring of a crashed konqueror:

    Imagine the crashed session is huge.
    May be not really huge but think of a session with 30 windows, some of them with 10 or more tabs starting on an elderly notebook.

    If I want to start a new konqueror instance it tries to restore the session (without asking), opening their windows, forking a myriad of various kio variants (http, http_cache, file,…), raising swap and my desktop gets totally out of control.

    With out of control I mean, that are not quite responsive on close requests.

    For some later revisions of konqueror a popup asked for confirmation, but this has gone.

    Also leaving the KDE session seems to duplicate some or all of the windows of the session (leading to exponential growth of the session).

    Also konqueror command line has no option to start a clean session or to discard the crash session.
    I have no other solution for this then to resort to firefox.

    Could this please be improved?
    Until then, how may I delete the “crash session”?

    • 25 sundoulos mayo 29, 2012 de 8:34 pm

      You say: “Save session every X seconds (it’s configurable via konquerorrc, 10 seconds by default as in firefox).”
      What is the configuration setting? I haven’t been able to figure out the right syntax. Thanks.

  25. 26 program do rozliczania pit junio 30, 2013 de 9:58 am

    Hi to all, for the reason that I am really keen of
    reading this weblog’s post to be updated daily. It contains fastidious material.

  26. 27 Stéphane diciembre 1, 2013 de 5:24 am

    Hi all,

    running Konqueror 4.8.4 on Debian 7.2, I lack this usefull featuer. Hence I made a
    simple manual crash handler based on a copy script whose pertinence is left to
    your appreciation.
    Action plan : a/ launch the script in bashrc for instance, b/ after the crash,
    manually restore the sesssion named “crashrecoverable”.

    The script is :

    ARG=”-r -f”
    mkdir –parents $LOCATION
    while (true); do
    ll $LOCATION
    sleep $TEMPO

    keywords : konqueror crash handler restore session manual

  27. 28 mommy makeover Kirkland septiembre 2, 2018 de 10:50 am

    I am actually grateful to the holder of this website who has shared this impressive piece of writing at at this place.

  1. 1 Linux 4 All » Archiwum bloga » Odtwarzanie sesji w Konquerorze Trackback en mayo 18, 2008 de 11:38 am
  2. 2 PlayOnLinux » Blog Archive » Odtwarzanie sesji w Konquerorze Trackback en mayo 18, 2008 de 10:51 pm
  3. 3 insurance broker Trackback en junio 27, 2014 de 10:54 pm
  4. 4 home theatre Trackback en julio 20, 2014 de 6:32 am
  5. 5 orlando bloom Trackback en julio 24, 2014 de 11:54 pm
  6. 6 cardboard balers Trackback en julio 25, 2014 de 3:24 pm
  7. 7 dental practice london essex Trackback en julio 31, 2014 de 7:29 am


Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google photo

Estás comentando usando tu cuenta de Google. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s


A %d blogueros les gusta esto: