Window.from_env
Find the window this process is running in.
Source and package
- Qualified name
-
libtmux::window:: Window:: from _env - Module
- window
- Declared in
Window- Package
- libtmux
- Source
- crates/libtmux/src/window.rs
-
Description#
Resolved through the pane named by
TMUX_PANE, which is the only value tmux gives a process that identifies exactly where it is.Ok(None)means tmux no longer has that pane.Errors
Returns an error when
TMUX_PANEis absent or is not a pane ID, or when the listing fails.Examples#
use libtmux::Window;let session = server.new_session("locating-window").await?;let pane = session.panes().await?.remove(0);// Standing in for the environment tmux gives a process it starts.let found = Window::from_env_value(server, Some(pane.id().as_ref())).await?;assert_eq!(found.expect("the window exists").id(), pane.window_id());- Parameters
-
-
server(&crate::Server ) #
-
Guides#
Pages that discuss from_env.