capture_pane hangs with `-S-`

Open
#251 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

Start with the shown libtmux Server and pane .cmd("capture-pane", ...) call, then compare its behavior with the equivalent command run from bash. Reproduce the hang on a pane using -S- and inspect the command's stdout handling. Done means capture_pane returns without hanging and preserves the expected output for affected panes.

Written by the indexing model from the issue text.

Description

I'm trying to expand the capture_pane functionality.
I'm using libtmux master on python3.7 with tmux 3.0 -
The following snippet hangs on some panes, while the same command works when run from bash;

>>> import libtmux; s = libtmux.Server(); s.children[0].children[0].children[1].cmd("capture-pane", '-p', '-J', '-e', '-E-', '-S-').stdout 
<omitted command noise>
DEBUG: ['/etc/profiles/per-user/myuser/bin/tmux', 'capture-pane', '-t', '%4', '-p', '-J', '-e', '-E-', '-S-']
<no output till ^C>

(I added some simple print debugging.)

list-panes gives the following:

$ tmux list-panes -t 0:
0: [135x17] [history 1952/2000, 939964 bytes] %0
1: [135x17] [history 928/2000, 431099 bytes] %4
2: [135x21] [history 1869/2000, 1194568 bytes] %5
3: [135x21] [history 0/2000, 0 bytes] %7
4: [271x13] [history 1816/2000, 269415 bytes] %1 (active)
5: [271x12] [history 6/2000, 1537 bytes] %132

The hang only seems to happen if I pass the -S- argument.

P.S.: previously at https://github.com/tmux-python/tmuxp/issues/529

Dominant language
Python
Stars
1.2k
Forks
127
Avg merge
2h 13m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tmux-python/libtmux

All issues in tmux-python/libtmux

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.