From 56a99a8a4e02477849f9a41dbb37f6ac9c6dcd99 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Fri, 6 Dec 2019 12:25:48 -0700 Subject: [PATCH] Avoid crash if tmux pane closes while getting size --- scripts/wk/tmux.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/wk/tmux.py b/scripts/wk/tmux.py index c4dfb2cd..5c6440b8 100644 --- a/scripts/wk/tmux.py +++ b/scripts/wk/tmux.py @@ -105,7 +105,11 @@ def layout_needs_fixed(panes, layout): if isinstance(pane_list, str): pane_list = [pane_list] for pane_id in pane_list: - width, height = get_pane_size(pane_id) + try: + width, height = get_pane_size(pane_id) + except ValueError: + # Pane may have disappeared during this loop + continue if data.get('width', False) and data['width'] != width: needs_fixed = True if data.get('height', False) and data['height'] != height: