diff options
Diffstat (limited to 'crates/dinggerd/src/watcher.rs')
| -rw-r--r-- | crates/dinggerd/src/watcher.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/dinggerd/src/watcher.rs b/crates/dinggerd/src/watcher.rs index 1aec88e..77b9259 100644 --- a/crates/dinggerd/src/watcher.rs +++ b/crates/dinggerd/src/watcher.rs @@ -28,6 +28,7 @@ //! and its control socket, for reloading agents on an old one //! - `@dingger_draft` the draft in the agent's input box, as one line //! - `@dingger_cost` what the agent's session spent today (see `cost`) +//! - `@dingger_context` how full its context window is, in whole percent use std::collections::HashMap; @@ -527,6 +528,12 @@ impl Watcher { (None, _) => change("@dingger_draft", &pane.written_draft, String::new()), _ => {} } + // And how full its context window is. + match (pane.agent, hooks::context(&pane.pane_id)) { + (Some(_), Some(context)) => change("@dingger_context", &pane.written_context, context), + (None, _) => change("@dingger_context", &pane.written_context, String::new()), + _ => {} + } if let Err(err) = tmux::set_pane_options(&pane.pane_id, &changes) { warn!(target = %pane.display_target, %err, "failed to write pane options"); } |
