-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with nvim terminal #24
Comments
I tried to reproduce but I couldn't get an error, and the terminal is loaded when I quit and run Could you please provide the settings you use? Also, please try setting the following options: require('possession').setup {
silent = true,
debug = true,
logfile = true,
-- ...
} and paste here the output from the logfile (defaults to Also, may this be somehow related to #8? |
Yes I think this is totally related to #8, but I don't understand how I can force their deletion ? |
You should be able to use: require('possession').setup {
plugins = {
delete_hidden_buffers = {
force = function(buf) return vim.api.nvim_buf_get_option(buf, 'buftype') == 'terminal' end
}
},
} It is described in more detail in |
It works ! Thanks a lot for this plugin. I don't want to flood your issues, I have another question, why my config doesn't save the session when I'm switching session with Config :
|
You don't actually have the autosave feature enabled. It requires "what" ( You could e.g. use: require('possession').setup {
-- ...
autosave = {
current = true,
tmp = true,
on_load = true,
on_quit = true,
},
-- ...
} You can check :h possession-autosave to see if you want both |
Ok i thought the options |
Also I don't find a way in the doc how to create a new empty Possession session. Since it's a custom json format I can't use the classic mksession command. |
What do you mean? You want to do this from Lua code? Because if not than you can just use the command :PossessionSave mysessionname. From Lua this function can be used. |
I want to get rid of tmux. And manage multiple nvim sessions with nvim. My dirty fix is to run a shell command inside nvim that create a new Possession session. Something like : |
I'm not sure if I understand the idea correctly, but if you want to just generate a blank session than what you're doing seems ok. If you want to avoid spawning new neovim, then you could generate a "blank session" from mksession and then use it with save. This is what I got when using let SessionLoad = 1
let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1
let v:this_session=expand("<sfile>:p")
silent only
silent tabonly
cd ~/workspace
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
endif
let s:shortmess_save = &shortmess
if &shortmess =~ 'A'
set shortmess=aoOA
else
set shortmess=aoO
endif
argglobal
%argdel
wincmd t
let s:save_winminheight = &winminheight
let s:save_winminwidth = &winminwidth
set winminheight=0
set winheight=1
set winminwidth=0
set winwidth=1
argglobal
enew
tabnext 1
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
silent exe 'bwipe ' . s:wipebuf
endif
unlet! s:wipebuf
set winheight=1 winwidth=20
let &shortmess = s:shortmess_save
let &winminheight = s:save_winminheight
let &winminwidth = s:save_winminwidth
let s:sx = expand("<sfile>:p:r")."x.vim"
if filereadable(s:sx)
exe "source " . fnameescape(s:sx)
endif
let &g:so = s:so_save | let &g:siso = s:siso_save
set hlsearch
nohlsearch
doautoall SessionLoadPost
unlet SessionLoad
" vim: set ft=vim : Then you can save it in Lua string variable as a "blank session template" ( local blank_session_template = [[...]]
local vimscript = replace_cwd(blank_session_template, my_cwd) -- would replace line 6 with correct cwd
require('possession.session').save('my-session-name', { vimscript = vimscript, no_confirm = true, cwd = my_cwd }) Would this be ok for your use case? |
It looks like PossessionSave is not compatible with nvim terminals.
This happen when I want to save a session containing multiple terminals.
The text was updated successfully, but these errors were encountered: