Comments (6)
It's not exactly clear to me what your issue is:
- What is the problem you are seeing?
- How do you want me to fix it?
from vim-session.
The HTR:
- open gvim or mvim and save a session.
- open vim in terminal and save the session again
- open gvim again and open the session
Observation:
The guifont and guioptions in the session saved in step 1. are lost.
The following code chould solve this problem
if is_all_tabs && (has('gui_running') || has('gui_macvim'))
call add(a:commands, 'set guioptions=' . escape(&go, ' "\'))
call add(a:commands, 'silent! set guifont=' . escape(&gfn, ' "\'))
endif
from vim-session.
Thanks for the clear description, I see what you mean now; I can reproduce it using MacVim. On Linux this works fine, which is why I'd never noticed, but MacVim has to act "special" again ;-). I can fix this, but I don't want to change the code for other platforms, because it works fine on e.g. Ubuntu Linux (GVim using GTK). So what I'll probably do is make the change conditional on whether has('macunix')
is true.
from vim-session.
By the way, in my version of MacVim has('gui_running')
is true when has('gui_macvim')
is true, so for me there would be ne reason to change that code. I guess the behavior is different on your system? What version of MacVim are you using? I'm running MacVim 7.3 including patches 1-646.
from vim-session.
I just noticed that has('macunix')
is false in console Vim on Mac OS X. That brought me to the cause of the bug you're seeing (most likely). When you run MacVim, you're probably executing one of these executables:
/Applications/MacVim.app/Contents/MacOS/MacVim
(always GUI)/Applications/MacVim.app/Contents/MacOS/Vim
(console or GUI depending on-g
argument)
Of course you probably don't type out the command above in a console; you run the mvim
wrapper script or click on the MacVim icon. When you run Vim in the console, I'm guessing you run this executable:
/usr/bin/vim
You can check this by:
- Confirming that when you run console Vim you normally type
vim
in the console to start it - Checking the output of the command
which vim
, this will report the full pathname of thevim
command
The /usr/bin/vim
executable is a console-only Vim which doesn't support any GUI options (they're all reported as empty strings by Vim). I guess it's included with Mac OS X by default. I can still fix this, but I always like to know the cause of a bug before I fix it :-)
Edit: If my assumption is correct, the best check would be has('gui')
(this indeeds reports false in /usr/bin/vim
on Mac OS X).
from vim-session.
I just released vim-session 2.3.11 on GitHub and Vim Online. This version fixes the problem you reported (I just tested it on Mac OS X with the version of MacVim I previously mentioned). I'm closing this issue now because I think the problem is resolved, but if the problem is not resolved then please feel free to reopen this issue. Thanks for the feedback & happy Vimming!
from vim-session.
Related Issues (20)
- gVim 8.1.1 full-screen HOT 2
- Saving session with makefile quicklist not working. HOT 4
- OpenSession - Entering a number without hitting enter
- autosave hidden unnamed buffers
- Persist markers into session? HOT 1
- Color scheme is not loaded properly when auto restoring session on VimEnter HOT 2
- RestartVim not working (linux vim 8.0.1453)
- Swich sessions HOT 1
- Forking this project HOT 1
- Files don't close when saving session in windows
- Missing/stale functions/mappings after some plugins get installed or removed
- Rename SaveSession, OpenSession, etc. to SessionSave, SessionOpen, etc.
- Swapfiles conflict when opening session in two Vim sessions
- Error while opening a session that contains at least one terminal buffer.
- Add support of Buffer Explorer plugin
- vim-session reorders the opened tabs
- newvim :setlocal buftype=acwrite & E676
- Save :Focus from vim-dispatch?
- slow
- Session is not completely restored on auto-load
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-session.