-
Notifications
You must be signed in to change notification settings - Fork 232
Fix layout related issues #737, #667, #704 #793
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
from libtmux.server import Server | ||
from libtmux.session import Session | ||
from libtmux.window import Window | ||
from libtmux.common import has_gte_version | ||
|
||
from . import exc | ||
from .util import get_current_pane, run_before_script | ||
|
@@ -217,6 +218,10 @@ def build(self, session=None, append=False): | |
assert self.sconf["session_name"] == session.name | ||
assert len(self.sconf["session_name"]) > 0 | ||
|
||
if has_gte_version("2.9"): | ||
# Use tmux default session size, overwrite Server::new_session | ||
session.set_option("default-size", "80x24") | ||
|
||
self.session = session | ||
self.server = session.server | ||
|
||
|
@@ -264,9 +269,6 @@ def build(self, session=None, append=False): | |
assert isinstance(p, Pane) | ||
p = p | ||
|
||
if "layout" in wconf: | ||
w.select_layout(wconf["layout"]) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tony If I recall correctly without this change the layout wasn't updated properly. It seems like I broke some things with this PR. I will investigate and I'll try to provide a fix. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nvasilas Thank you! Let's see how it goes! |
||
if "focus" in pconf and pconf["focus"]: | ||
focus_pane = p | ||
|
||
|
@@ -281,6 +283,8 @@ def build(self, session=None, append=False): | |
if focus_pane: | ||
focus_pane.select_pane() | ||
|
||
w.select_layout(wconf.get("layout", "even-vertical")) | ||
|
||
if focus: | ||
focus.select_window() | ||
|
||
|
@@ -421,8 +425,6 @@ def get_pane_shell(): | |
) | ||
|
||
assert isinstance(p, Pane) | ||
if "layout" in wconf: | ||
w.select_layout(wconf["layout"]) | ||
|
||
if "suppress_history" in pconf: | ||
suppress = pconf["suppress_history"] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I learned something new:
main-horizontal
doesn't necessarily guarantee the top pane will be bigger.I will try to remedy this in #809