Skip to content

Commit a729240

Browse files
committed
!squash pane
1 parent 10dc940 commit a729240

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/libtmux/pane.py

+12-13
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import warnings
1111
from typing import overload
1212

13-
from libtmux.common import tmux_cmd
13+
from libtmux.common import has_gte_version, tmux_cmd
1414
from libtmux.constants import (
1515
RESIZE_ADJUSTMENT_DIRECTION_FLAG_MAP,
1616
ResizeAdjustmentDirection,
@@ -197,21 +197,20 @@ def resize_pane(
197197
elif height or width:
198198
## Manual resizing
199199
if height:
200-
if (
201-
isinstance(height, str)
202-
and not height.isdigit()
203-
and not height.endswith("%")
204-
):
205-
raise exc.RequiresDigitOrPercentage
200+
if isinstance(height, str):
201+
if height.endswith("%") and not has_gte_version("3.1"):
202+
raise exc.VersionTooLow
203+
if not height.isdigit() and not height.endswith("%"):
204+
raise exc.RequiresDigitOrPercentage
206205
tmux_args += (f"-y{height}",)
207206

208207
if width:
209-
if (
210-
isinstance(width, str)
211-
and not width.isdigit()
212-
and not width.endswith("%")
213-
):
214-
raise exc.RequiresDigitOrPercentage
208+
if isinstance(width, str):
209+
if width.endswith("%") and not has_gte_version("3.1"):
210+
raise exc.VersionTooLow
211+
if not width.isdigit() and not width.endswith("%"):
212+
raise exc.RequiresDigitOrPercentage
213+
215214
tmux_args += (f"-x{width}",)
216215
elif zoom:
217216
## Zoom / Unzoom

0 commit comments

Comments
 (0)