Bug 1303304 - gvim windows are empty when restoring saved session in KDE
gvim windows are empty when restoring saved session in KDE
Product: Fedora
Classification: Fedora
Component: vim (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Karsten Hopp
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2016-01-30 08:29 EST by Jonathan Wakely
Modified: 2016-04-20 07:09 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-04-20 05:31:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jonathan Wakely 2016-01-30 08:29:53 EST
Description of problem:

Gvim does not work with KDE's session management.

Version-Release number of selected component (if applicable):

I don't know if this is a problem in gvim or in KDE (and I never know which component of KDE is relevant to a bug):


How reproducible:


Steps to Reproduce:
1. Open some files in gvim
2. Have KDE set to either restore session on login, or restore saved session.
3. Log out of KDE (saving session manually if required by configuration) and log back in.

Actual results:

Gvim windows are restored, but without an open file, and with $HOME as the working directory.

Expected results:

Gvim windows should be restored with the previously open files and working directories.

Additional info:

I read somewhere that having 'set guifont' in gvimrc prevents sessions being restored correctly in KDE, but removing that line doesn't seem to help in Fedora. It's also not a good workaround, as I don't want to have to use the default font (or large default font size).
Comment 1 Karsten Hopp 2016-04-20 05:31:43 EDT
I think you need either a plugin like http://www.vim.org/scripts/script.php?script_id=3150
or use something like
'autocmd VimLeavePre * mksession! .vim.sess' and 
gvim -S .vim.sess as described at http://superuser.com/questions/148802/restore-session-in-gvim-like-in-firefox

Neither solution is something I would like to add to vim atm. Session management  really needs to be fixed upstream. Better support for mksession is one of the features that VIM sponsors have voted upon, but is is way down the list: http://www.vim.org/sponsor/vote_results.php
Comment 2 Jonathan Wakely 2016-04-20 07:06:48 EDT
Thanks, that makes sense (although I'd say in that case KDE should not be trying to save gvim windows at all if it doesn't work).
Comment 3 Jonathan Wakely 2016-04-20 07:09:59 EDT
The plugin looks useful, especially if I can somehow get KDE to trigger it when saving a session. Thanks again.

Note You need to log in before you can comment on or make changes to this bug.