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

Here is a simple example to use this library.

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
ドキュメント
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
documentation

調査の方向性

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)

image

主要言語
Python
スター
1.2k
フォーク
127
平均マージ
2時間 13分
マージ済み PR(30日)
1

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

tmux-python/libtmux のほかの issue

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

似ている issue

Python の issue をもっと見る

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

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