How to use the libtmux.Pane function in libtmux

To help you get started, we’ve selected a few libtmux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tmux-python / libtmux / tests / test_session.py View on Github external
def test_attached_pane(session):
    """Session.attached_pane returns Pane."""
    assert isinstance(session.attached_pane, Pane)
github tmux-python / libtmux / tests / test_tmuxobject.py View on Github external
get_by_id = session.get_by_id(window_id)

            assert get_by_id == window
            assert isinstance(get_by_id, Window)

            assert session.get_by_id('@' + next(namer)) is None

            # window.get_by_id
            for pane in window.panes:
                pane_id = pane.get('pane_id')

                get_by_id = window.get_by_id(pane_id)

                assert get_by_id == pane
                assert isinstance(get_by_id, Pane)
                assert window.get_by_id('%' + next(namer)) is None
github tmux-python / libtmux / tests / test_tmuxobject.py View on Github external
assert server.find_where({'session_id': session_id}) == session
        assert isinstance(server.find_where({'session_id': session_id}), Session)

        # session.find_where
        for window in session.windows:
            window_id = window.get('window_id')

            assert session.find_where({'window_id': window_id}) == window
            assert isinstance(session.find_where({'window_id': window_id}), Window)

            # window.find_where
            for pane in window.panes:
                pane_id = pane.get('pane_id')

                assert window.find_where({'pane_id': pane_id}) == pane
                assert isinstance(window.find_where({'pane_id': pane_id}), Pane)
github tmux-python / tmuxp / tests / test_tmuxobject.py View on Github external
assert find_where == window
            assert isinstance(find_where, Window)

            # window.findWhere
            for pane in window.panes:
                pane_id = pane.get('pane_id')
                pane_tty = pane.get('pane_tty')

                find_where = window.findWhere({
                    'pane_id': pane_id,
                    'pane_tty': pane_tty
                })

                assert find_where == pane
                assert isinstance(find_where, Pane)
github tmux-python / libtmux / tests / test_window.py View on Github external
def test_split_window_shell(session):
    """Window.split_window() splits window, returns new Pane, vertical."""
    window_name = 'test split window'
    cmd = 'sleep 1m'
    window = session.new_window(window_name=window_name, attach=True)
    pane = window.split_window(shell=cmd)
    assert len(window.panes) == 2
    assert isinstance(pane, Pane)
    assert float(window.panes[0].height) <= ((float(window.width) + 1) / 2)
    assert pane.get('pane_start_command') == cmd
github tmux-python / tmuxp / tests / test_session.py View on Github external
def test_attached_pane(session):
    """Session.attached_pane() returns Pane."""
    assert isinstance(session.attached_pane(), Pane)
github tmux-python / tmuxp / tests / test_window.py View on Github external
def test_split_window(session):
    """Window.split_window() splits window, returns new Pane."""
    window_name = 'test split window'
    window = session.new_window(window_name=window_name, attach=True)
    pane = window.split_window()
    assert len(window.panes) == 2
    assert isinstance(pane, Pane)
github tmux-python / libtmux / tests / test_window.py View on Github external
def test_attached_pane(session):
    """Window.attached_window returns active Pane."""

    window = session.attached_window  # current window
    assert isinstance(window.attached_pane, Pane)
github tmux-python / tmuxp / tests / test_window.py View on Github external
def test_attached_pane(session):
    """Window.attached_window() returns active Pane."""

    window = session.attached_window()  # current window
    assert isinstance(window.attached_pane(), Pane)
github tmux-python / tmuxp / tests / test_tmuxobject.py View on Github external
# session.findWhere
        for window in session.windows:
            window_id = window.get('window_id')

            assert session.findWhere({'window_id': window_id}) == window
            assert isinstance(
                session.findWhere({'window_id': window_id}), Window
            )

            # window.findWhere
            for pane in window.panes:
                pane_id = pane.get('pane_id')

                assert window.findWhere({'pane_id': pane_id}) == pane
                assert isinstance(
                    window.findWhere({'pane_id': pane_id}), Pane)