From 385bdd7dbf11f3e5f6b99029263ea9f4fc2f7879 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 17 Dec 2018 20:10:58 -0700 Subject: [PATCH] Allow resizing current pane --- .bin/Scripts/functions/tmux.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.bin/Scripts/functions/tmux.py b/.bin/Scripts/functions/tmux.py index 5fbca65d..20f35921 100644 --- a/.bin/Scripts/functions/tmux.py +++ b/.bin/Scripts/functions/tmux.py @@ -28,12 +28,15 @@ def tmux_poll_pane(pane_id): panes = result.stdout.decode().splitlines() return pane_id in panes -def tmux_resize_pane(pane_id, x=None, y=None): +def tmux_resize_pane(pane_id=None, x=None, y=None): """Resize pane to specific hieght or width.""" if not x and not y: raise Exception('Neither height nor width specified.') - cmd = ['tmux', 'resize-pane', '-t', pane_id] + cmd = ['tmux', 'resize-pane'] + if pane_id: + # NOTE: If pane_id not specified then the current pane will be resized + cmd.extend(['-t', pane_id]) if x: cmd.extend(['-x', str(x)]) elif y: