aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_session.c6
-rw-r--r--src/nvim/options.lua2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c
index 6ca6da9cd0..1d670afa6d 100644
--- a/src/nvim/ex_session.c
+++ b/src/nvim/ex_session.c
@@ -193,6 +193,9 @@ static int ses_do_win(win_T *wp)
if (bt_help(wp->w_buffer)) {
return ssop_flags & SSOP_HELP;
}
+ if (bt_terminal(wp->w_buffer)) {
+ return ssop_flags & SSOP_TERMINAL;
+ }
return true;
}
@@ -407,6 +410,8 @@ static int put_view(FILE *fd, win_T *wp, int add_edit, unsigned *flagp, int curr
if ((flagp == &ssop_flags) && alt != NULL && alt->b_fname != NULL
&& *alt->b_fname != NUL
&& alt->b_p_bl
+ // do not set balt if buffer is terminal and "terminal" is not set in options
+ && !(bt_terminal(alt) && !(ssop_flags & SSOP_TERMINAL))
&& (fputs("balt ", fd) < 0
|| ses_fname(fd, alt, flagp, true) == FAIL)) {
return FAIL;
@@ -616,6 +621,7 @@ static int makeopens(FILE *fd, char_u *dirnow)
FOR_ALL_BUFFERS(buf) {
if (!(only_save_windows && buf->b_nwindows == 0)
&& !(buf->b_help && !(ssop_flags & SSOP_HELP))
+ && !(bt_terminal(buf) && !(ssop_flags & SSOP_TERMINAL))
&& buf->b_fname != NULL
&& buf->b_p_bl) {
if (fprintf(fd, "badd +%" PRId64 " ",
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index 9e4a6a084c..2f941f5d0c 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -2063,7 +2063,7 @@ return {
type='string', list='onecomma', scope={'global'},
deny_duplicates=true,
varname='p_ssop',
- defaults={if_true="blank,buffers,curdir,folds,help,tabpages,winsize"}
+ defaults={if_true="blank,buffers,curdir,folds,help,tabpages,winsize,terminal"}
},
{
full_name='shada', abbreviation='sd',