Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Specific exceptions raising if pane or window manually closed

オープン
#340 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
api, cli

調査の方向性

The traceback points to libtmux/pane.py (_info and send_keys) and libtmux/window.py (_info and kill_window); start there and reproduce each operation after its pane or window is manually closed. Done means these cases raise specific exceptions instead of IndexError.

索引モデルが issue の本文から書いたものです。

説明

Specific exceptions should be raised in some cases.

For example, if we send keys to a previously attached pane of a window, but the window is manually closed while the program is running, this hapens:

Traceback (most recent call last)
[...]
 File "/usr/share//class_tmuxserver.py", line 78, in create_or_clear_window
    self.dict_panes[window_name]["pane_cmd"].send_keys('C-c', enter=False, suppress_history=False)

  File "/usr/share//venv/lib/python3.8/site-packages/libtmux/pane.py", line 117, in send_keys
    self.cmd('send-keys', prefix + cmd)
  File "/usr/share//venv/lib/python3.8/site-packages/libtmux/pane.py", line 90, in cmd
    args = ('-t', self.get('pane_id')) + args
  File "/usr/local/lib/python3.8/_collections_abc.py", line 660, in get
    return self[key]
  File "/usr/share//venv/lib/python3.8/site-packages/libtmux/common.py", line 251, in __getitem__
    return self._info[key]
  File "/usr/share//venv/lib/python3.8/site-packages/libtmux/pane.py", line 75, in _info
    return list(filter(by, self.server._panes))[0]
`IndexError: list index out of range`

Same thing if we try to kill a window which was manually closed in the tmux:

Traceback (most recent call last)
 [...]
  File "/home/admin//src/class_tmuxserver.py", line 116, in kill_tmux_window
    self.dict_windows[window_name].kill_window()
  File "/home/admin//venv/lib64/python3.7/site-packages/libtmux/window.py", line 308, in kill_window
    '-t%s:%s' % (self.get('session_id'), self.index),
  File "/usr/lib64/python3.7/_collections_abc.py", line 660, in get
    return self[key]
  File "/home/admin//venv/lib64/python3.7/site-packages/libtmux/common.py", line 252, in __getitem__
    return self._info[key]
  File "/home/admin//venv/lib64/python3.7/site-packages/libtmux/window.py", line 89, in _info
    return ret[0]
IndexError: list index out of range
主要言語
Python
スター
1.2k
フォーク
127
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tmux-python/libtmux のほかの issue

tmux-python/libtmux の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。