Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
2Shirt 2024-03-23 22:37:30 -07:00
commit 25b18ebabc
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 6 additions and 5 deletions

View file

@ -38,4 +38,5 @@ WINDOWS_BUILDS = {
# Windows 11
'10.0.22000': '21H2',
'10.0.22621': '22H2',
'10.0.22631': '23H2',
}

View file

@ -118,7 +118,7 @@ def fix_layout(
def get_pane_size(pane_id: str | None = None) -> tuple[int, int]:
"""Get current or target pane size, returns tuple."""
cmd = ['tmux', 'display', '-p']
cmd = ['tmux', 'display-message', '-p']
if pane_id:
cmd.extend(['-t', pane_id])
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]:
"""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
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:
"""Check if pane exists, returns bool."""
cmd = ['tmux', 'list-panes', '-F', '#D']
cmd = ['tmux', 'list-panes', '-F', '#{pane_id}']
# Get list of panes
proc = run_program(cmd, check=False)
@ -314,7 +314,7 @@ def split_window(
target_id: str | None = None,
**action) -> 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
if not (lines or percent):
@ -335,7 +335,7 @@ def split_window(
if lines:
cmd.extend(['-l', str(lines)])
elif percent:
cmd.extend(['-p', str(percent)])
cmd.extend(['-l', f'{percent}%'])
# New pane action
cmd.extend(prep_action(**action))