Skip to content

Commit 927f323

Browse files
committed
fix: strip ansi escapes from cli input
1 parent b2af7f9 commit 927f323

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

Cargo.lock

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ categories = ["command-line-utilities"]
1212
edition = "2021"
1313

1414
[dependencies]
15+
anstream = "0.6.15"
1516
clap = { version = "4.5.9", features = ["derive"] }
1617
clap-stdin = "0.4.0"
1718
color-eyre = "0.6.3"

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use color_eyre::eyre::Result;
33
use clap::Parser;
44
use clap_stdin::MaybeStdin;
55

6+
use anstream::{adapter::strip_str, println};
67
use crossterm::terminal;
78

89
use kittysay::{generate, FormatOptions, KITTY};
@@ -36,7 +37,7 @@ fn main() -> Result<()> {
3637
width,
3738
};
3839

39-
let msg = generate(&args.message, &format_opts);
40+
let msg = generate(&strip_str(&args.message).to_string(), &format_opts);
4041

4142
let mut msg_color = console::Color::White;
4243
let mut cat_color = console::Color::White;

0 commit comments

Comments
 (0)