For example, if I try to run git log --online, I'm getting the ANSI characters instead of the color.
In the preview, it works well and I can see the colors.
code example:
extern crate skim;
use skim::prelude::*;
pub fn main() {
let glogm = Some("git log --oneline");
let options = SkimOptionsBuilder::default()
.height(Some("50%"))
.cmd(glogm)
.preview(Some("echo {}"))
.multi(true)
.reverse(true)
.build()
.unwrap();
let selected_items = Skim::run_with(&options, None)
.map(|out| out.selected_items)
.unwrap_or_else(|| Vec::new());
for item in selected_items.iter() {
print!("selected: {}{}", item.output(), "\n");
}
}
For example, if I try to run
git log --online
, I'm getting the ANSI characters instead of the color. In the preview, it works well and I can see the colors.code example: