Bug 1303304 - gvim windows are empty when restoring saved session in KDE
Summary: gvim windows are empty when restoring saved session in KDE
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-30 13:29 UTC by Jonathan Wakely
Modified: 2016-04-20 11:09 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-04-20 09:31:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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