Here is a simple example to use this library.
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 25/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
Start by reviewing the inline Python example, especially its libtmux window and pane commands, and compare it with the repository's existing documentation structure. The requested outcome is unclear: determine whether the project needs a documented libtmux example or guidance to use a bash script, then make the chosen example runnable and clear.
索引モデルが issue の本文から書いたものです。
説明
When I use the library to split window, I use win.cmd('split-window', '-h') which let me spend a lot of time.
At last, I suggest to use bash script instead of this library.
#!/usr/bin/env python3
# coding=utf-8
# author: thinkycx
# date: 2018-01-11
# Usage:
# run several commands in tmux panel, every window have 4 panes
# $ pip3 install libtmux
# $ python tmux.py
import libtmux
import math
import os
import logging
def create_session(session_name, commands):
'''
create session with 2*2 panes and run commands
:param session_name: tmux session name
:param commands: bash commands
:return:
'''
logging.info(commands)
# pane_NUM = 3
# WINDOW_NUM = int(math.ceil(len(commands)/4.0)) # in python3, we can use 4 also
server = libtmux.Server()
session = server.new_session(session_name)
# create windows
windows = []
panes = []
for i in range(len(commands)):
# create window to store 4 panes
if i % 4 == 0:
win = session.new_window(attach=False, window_name="win"+str(int(i/4)))
windows.append(win)
# tmux_args = ('-h',)
win.cmd('split-window', '-h')
win.cmd('split-window', '-f')
win.cmd('split-window', '-h')
panes.extend(win.list_panes())
panes[i].send_keys(commands[i])
logging.info(panes)
logging.info(windows)
if __name__ == '__main__':
commands = []
for i in range(10):
commands.append("echo " + str(i))
os.system("tmux kill-session -t session")
create_session("session", commands)

- 主要言語
- Python
- スター
- 1.2k
- フォーク
- 127
- 平均マージ
- 2時間 13分
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tmux-python/libtmux のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
tmux-python/libtmux#759 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
tmux-python/libtmux#745 · コメント 2 件 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
tmux-python/libtmux#744 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tmux-python/libtmux#731 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
tmux-python/libtmux#654 ·
tmux-python/libtmux の issue をすべて見る
似ている issue
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-webui/open-webui#30750 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 90/100