diff options
Diffstat (limited to 'crates/dinggerd/src/tmux.rs')
| -rw-r--r-- | crates/dinggerd/src/tmux.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/dinggerd/src/tmux.rs b/crates/dinggerd/src/tmux.rs index 136260e..80adbb5 100644 --- a/crates/dinggerd/src/tmux.rs +++ b/crates/dinggerd/src/tmux.rs @@ -36,6 +36,8 @@ pub struct Pane { pub written_draft: String, /// What the agent's session spent today (UTC), in dollars. pub written_cost: String, + /// How full the agent's context window is, in whole percent. + pub written_context: String, } @@ -121,14 +123,15 @@ pub fn list_panes() -> Result<Vec<Pane>, String> { "#{@dingger_extension}\t", "#{@dingger_control}\t", "#{@dingger_draft}\t", - "#{@dingger_cost}", + "#{@dingger_cost}\t", + "#{@dingger_context}", ); let out = run_tmux(&["list-panes", "-a", "-F", format])?; let mut panes: Vec<Pane> = Vec::new(); let mut process_tree = None; for line in out.lines() { let fields: Vec<&str> = line.split('\t').collect(); - if fields.len() < 24 { + if fields.len() < 25 { continue; } let attended = fields[4] == "1" && fields[5] != "0"; @@ -175,6 +178,7 @@ pub fn list_panes() -> Result<Vec<Pane>, String> { written_control: fields[21].to_string(), written_draft: fields[22].to_string(), written_cost: fields[23].to_string(), + written_context: fields[24].to_string(), }); } Ok(panes) |
