Skip to content

Commit 6356179

Browse files
committed
don't empty pane_current_path if new one is empty
sometimes even repeated polling for a new pane path over 1, 3, 5 seconds won't return anything in some instances. In older cases, we'd remove the pane_current_path from the pane's _info, now we'll keep the last non-empty result libtmux found until a new one fills it.
1 parent 3d4c78c commit 6356179

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libtmux/server.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,13 @@ def _list_panes(self):
264264

265265
# clear up empty dict
266266
panes = [
267-
dict((k, v) for k, v in window.items() if v) for window in panes
267+
dict(
268+
(k, v) for k, v in window.items()
269+
if v or
270+
k == 'pane_current_path'
271+
) # preserve pane_current_path, in case it entered a new process
272+
# where we may not get a cwd from.
273+
for window in panes
268274
]
269275

270276
if self._panes:

0 commit comments

Comments
 (0)