Bug 1303304

Summary: gvim windows are empty when restoring saved session in KDE
Product: [Fedora] Fedora Reporter: Jonathan Wakely <jwakely>
Component: vimAssignee: Karsten Hopp <karsten>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: ignatenko, karsten, moshima.web
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-20 09:31:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Wakely 2016-01-30 13:29:53 UTC
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):

vim-X11-7.4.827-1.fc23.x86_64
plasma-workspace-5.5.3-4.fc23.x86_64


How reproducible:

Always.

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 09:31:43 UTC
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 11:06:48 UTC
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 11:09:59 UTC
The plugin looks useful, especially if I can somehow get KDE to trigger it when saving a session. Thanks again.