On this page
window.Window.select
- Module
- window
- Declared in
- Window
- Package
- libtmux
- Source
- crates/libtmux/src/window.rs
- Other languages
- PythonTypeScriptGoJava.NETC++Swift
-
Make this window active in the session it was reached through.
Targeted by id rather than by index. An index is a slot, not an identity: anything that renumbers windows -- breaking a lone pane out of one moves it to a free index -- leaves a handle's cached index pointing at whatever occupies that slot now, which is a different live window rather than nothing. tmux answers such a target without complaint, so an index-scoped select would switch to the wrong window and report success.
Errors
Returns an error when tmux refuses the command, and
Error::ObjectGonewhen the window is no longer on the server.In other languages Make a window active
- Python
libtmux.Window.select - TypeScript
window.Window.select - Go
tmux.Window.Select - Java
io.github.libtmux.Window.Window.select - .NET
LibTmux.Window.SelectAsync - C++
libtmux::Window::select - Swift
Server.select(_:)
- Python
Examples
>>> window = session.active_window
>>> new_window = session.new_window()
>>> session.refresh()
>>> active_windows = [w for w in session.windows if w.window_active == '1'] >>> new_window.window_active == '1'
False >>> new_window.select()
Window(...) >>> new_window.window_active == '1'
True await window.select(); 0 declared, 0 inherited