window.Window.last_activity
- Module
- window
- Declared in
- Window
- Package
- libtmux
- Source
- crates/libtmux/src/window.rs
- Other languages
- Python TypeScript Go Java .NET C++ Swift
-
Return when the window last produced output.
tmux stamps this on every byte a pane in the window writes, whatever the window options say. That is what separates it from
Self::has_activity, which is an alert and stays false unlessmonitor-activitywas turned on -- and it is off by default.tmux keeps whole seconds.
WindowFields::window_activityfilters and reads the same field as thei64of Unix seconds tmux reports, because the query grammar compares integers.Examples
use std::time::{Duration, SystemTime};let guard = libtmux::test::TestServer::new().await?;let session = guard.server().new_session("busy").await?;let window = session.active_window().await?.expect("a window");// A window that has just been made has already produced output.let idle = SystemTime::now().duration_since(window.last_activity())?;assert!(idle < Duration::from_secs(3600));guard.shutdown().await?;In other ports When a window last showed activity
- Python
libtmux.Window.window_activity - TypeScript no equivalent on
Window - Go
tmux.Window.Activity - Java no equivalent on
Window - .NET no equivalent on
Window - C++
libtmux::Window::activity - Swift no equivalent on
Window
- Python
0 declared, 0 inherited