Update tmux sections to reflect upstream changes
This commit is contained in:
parent
58069f9db2
commit
272fd3e43f
1 changed files with 5 additions and 5 deletions
|
|
@ -118,7 +118,7 @@ def fix_layout(
|
||||||
|
|
||||||
def get_pane_size(pane_id: str | None = None) -> tuple[int, int]:
|
def get_pane_size(pane_id: str | None = None) -> tuple[int, int]:
|
||||||
"""Get current or target pane size, returns tuple."""
|
"""Get current or target pane size, returns tuple."""
|
||||||
cmd = ['tmux', 'display', '-p']
|
cmd = ['tmux', 'display-message', '-p']
|
||||||
if pane_id:
|
if pane_id:
|
||||||
cmd.extend(['-t', pane_id])
|
cmd.extend(['-t', pane_id])
|
||||||
cmd.append('#{pane_width} #{pane_height}')
|
cmd.append('#{pane_width} #{pane_height}')
|
||||||
|
|
@ -140,7 +140,7 @@ def get_pane_size(pane_id: str | None = None) -> tuple[int, int]:
|
||||||
|
|
||||||
def get_window_size() -> tuple[int, int]:
|
def get_window_size() -> tuple[int, int]:
|
||||||
"""Get current window size, returns tuple."""
|
"""Get current window size, returns tuple."""
|
||||||
cmd = ['tmux', 'display', '-p', '#{window_width} #{window_height}']
|
cmd = ['tmux', 'display-message', '-p', '#{window_width} #{window_height}']
|
||||||
|
|
||||||
# Get resolution
|
# Get resolution
|
||||||
proc = run_program(cmd, check=False)
|
proc = run_program(cmd, check=False)
|
||||||
|
|
@ -192,7 +192,7 @@ def layout_needs_fixed(layout: dict[str, dict[str, Any]]) -> bool:
|
||||||
|
|
||||||
def poll_pane(pane_id: str) -> bool:
|
def poll_pane(pane_id: str) -> bool:
|
||||||
"""Check if pane exists, returns bool."""
|
"""Check if pane exists, returns bool."""
|
||||||
cmd = ['tmux', 'list-panes', '-F', '#D']
|
cmd = ['tmux', 'list-panes', '-F', '#{pane_id}']
|
||||||
|
|
||||||
# Get list of panes
|
# Get list of panes
|
||||||
proc = run_program(cmd, check=False)
|
proc = run_program(cmd, check=False)
|
||||||
|
|
@ -314,7 +314,7 @@ def split_window(
|
||||||
target_id: str | None = None,
|
target_id: str | None = None,
|
||||||
**action) -> str:
|
**action) -> str:
|
||||||
"""Split tmux window, run action, and return pane_id as str."""
|
"""Split tmux window, run action, and return pane_id as str."""
|
||||||
cmd = ['tmux', 'split-window', '-d', '-PF', '#D']
|
cmd = ['tmux', 'split-window', '-d', '-PF', '#{pane_id}']
|
||||||
|
|
||||||
# Safety checks
|
# Safety checks
|
||||||
if not (lines or percent):
|
if not (lines or percent):
|
||||||
|
|
@ -335,7 +335,7 @@ def split_window(
|
||||||
if lines:
|
if lines:
|
||||||
cmd.extend(['-l', str(lines)])
|
cmd.extend(['-l', str(lines)])
|
||||||
elif percent:
|
elif percent:
|
||||||
cmd.extend(['-p', str(percent)])
|
cmd.extend(['-l', f'{percent}%'])
|
||||||
|
|
||||||
# New pane action
|
# New pane action
|
||||||
cmd.extend(prep_action(**action))
|
cmd.extend(prep_action(**action))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue