- Module
- session
- Declared in
- Session
- Package
- libtmux
- Source
- crates/libtmux/src/session.rs
- Other languages
- Python TypeScript GoJava.NETC++Swift
-
Move to the next window, and return it.
Nonewhen there is no next window, which a session holding one window never has. That is an ordinary state rather than a failure, so it is reported as absence; an error means tmux could not be reached or refused the move for some other reason.Errors
Returns an error when tmux cannot be reached or refuses the move.
In other ports Move to the next window of a session
- Python
libtmux.Session.next_window - TypeScript
Session.selectWindowtakesnext,previousorlast - Go
tmux.Session.NextWindow - Java
io.github.libtmux.Session.Session.nextWindow - .NET
LibTmux.Session.SelectNextWindowAsync - C++
libtmux::Session::select_next_window - Swift
Server.selectNextWindow(in:)
- Python
Examples
let guard = libtmux::test::TestServer::new().await?;let session = guard.server().new_session("moving").await?;
// One window, so there is nowhere to go and nothing broke.assert!(session.next_window().await?.is_none());
session.new_window("second").await?;assert!(session.next_window().await?.is_some());
guard.shutdown().await?;>>> w = session.new_window(window_name='nw_test')>>> session.next_window()Window(...)0 declared, 0 inherited