diff --git a/src/tui/mod.rs b/src/tui/mod.rs index cd150dc..7402f65 100644 --- a/src/tui/mod.rs +++ b/src/tui/mod.rs @@ -72,6 +72,7 @@ const HELP_TEXT: &str = "Generic: f toggle show active filters z zoom in on a selected field + y copy the selected value to the clipboard ─────────────────────────────────────────────────────── targeting logs: @@ -80,7 +81,7 @@ targeting logs: (to target values of fields) t the currently selected log - the surrounding element (when inside a span) + s the surrounding element (when inside a span) either a field after `f` or the text of the current log: p ... with a prefix @@ -377,7 +378,19 @@ impl App { } } KeyCode::Char('y') => { - if let Some((_, _, value)) = lv.get_selected_field() { + let value = if let Some((_, _, value)) = lv.get_selected_field() { + if let InputState::Target(InputTarget::Fields(..)) = lv.input_state { + Some(value) + } else if let Some((l, _)) = lv.selected() { + Some(l.line_text("".to_string(), &lv.filters).message) + } else { + None + } + } else { + None + }; + + if let Some(value) = value { match arboard::Clipboard::new() { Ok(mut cb) => { #[allow(unused_mut)]