12
12
from libtmux .server import Server
13
13
from libtmux .session import Session
14
14
from libtmux .window import Window
15
+ from libtmux .common import has_gte_version
15
16
16
17
from . import exc
17
18
from .util import get_current_pane , run_before_script
@@ -217,6 +218,10 @@ def build(self, session=None, append=False):
217
218
assert self .sconf ["session_name" ] == session .name
218
219
assert len (self .sconf ["session_name" ]) > 0
219
220
221
+ if has_gte_version ("2.6" ):
222
+ # Use tmux default session size, overwrite Server::new_session
223
+ session .set_option ("default-size" , "80x24" )
224
+
220
225
self .session = session
221
226
self .server = session .server
222
227
@@ -264,9 +269,6 @@ def build(self, session=None, append=False):
264
269
assert isinstance (p , Pane )
265
270
p = p
266
271
267
- if "layout" in wconf :
268
- w .select_layout (wconf ["layout" ])
269
-
270
272
if "focus" in pconf and pconf ["focus" ]:
271
273
focus_pane = p
272
274
@@ -281,6 +283,8 @@ def build(self, session=None, append=False):
281
283
if focus_pane :
282
284
focus_pane .select_pane ()
283
285
286
+ w .select_layout (wconf .get ("layout" , "even-vertical" ))
287
+
284
288
if focus :
285
289
focus .select_window ()
286
290
@@ -421,8 +425,6 @@ def get_pane_shell():
421
425
)
422
426
423
427
assert isinstance (p , Pane )
424
- if "layout" in wconf :
425
- w .select_layout (wconf ["layout" ])
426
428
427
429
if "suppress_history" in pconf :
428
430
suppress = pconf ["suppress_history" ]
0 commit comments