traceviewer 0.1.2

Run a command and inspect its logs in a scrollable terminal viewer
1
2
3
4
5
6
7
8
9
10
11
12
use std::io::{self, Write};

use anyhow::Result;
use base64::{Engine as _, engine::general_purpose::STANDARD};

pub(crate) fn copy_to_clipboard(text: &str) -> Result<()> {
    let encoded = STANDARD.encode(text);
    let mut stdout = io::stdout();
    write!(stdout, "\x1b]52;c;{encoded}\x07")?;
    stdout.flush()?;
    Ok(())
}