libtmux.Window.linked_sessions
Python
- Python
- Ruby Unavailable
- Lua Unavailable
- TypeScript
- Rust
- Go
- Java Unavailable
- .NET
- C++ Unavailable
- Swift Unavailable
- Module
- libtmux
- Declared in
- Window
- Package
- libtmux
- Source
- src/libtmux/window.py
- Other languages
- Ruby Lua TypeScriptRustGo Java .NET C++ Swift
-
Every session this window is reachable from.
Usually one, and then this is just
Window.sessionin a list.link-windowand grouped sessions (tmux new-session -t existing) make it more: the window is genuinely in each of them at once, andWindow.sessionreturns the session recorded on thisWindowinstance.Each session is listed once, however many indexes it links the window at, and they come back in the order tmux lists them. Fetching the holders takes two list commands total, independent of how many there are. If either listing fails, the result is empty.
Discussed in Filtering and queries
In other ports Every session a window is linked into
- Ruby No source-verified Ruby equivalent is recorded for this operation.
- Lua No source-verified Lua equivalent is recorded for this operation.
- TypeScript
window.Window.linkedSessions - Rust
window.Window.linked_sessions - Go
tmux.Window.LinkedSessions - Java no equivalent on
Window - .NET
LibTmux.Window.LinkedSessions - C++
Window::linked_sessionscounts them rather than listing them - Swift no equivalent on
Window
Examples
A window you just made belongs to the session you made it in:
>>> window = session.new_window(window_name="solo", attach=False)>>> [s.session_name for s in window.linked_sessions] == [session.session_name]TrueLink it into a second session and it belongs to both:
>>> guest = server.new_session(session_name="guest")>>> target = f"{guest.session_id}:">>> _ = server.cmd("link-window", "-d", "-s", window.window_id, "-t", target)>>> sorted(s.session_name for s in window.linked_sessions) == sorted(... [session.session_name, "guest"]... )Truewindow.linkedSessions.map((entry) => entry.name);0 declared, 0 inherited