Closed AnirudhRahul closed 3 months ago
Same here:
╭─ ~/Documents/projet/src │
user@machine
╰─ code2prompt src
▹▹▹▹▸ Done! thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/code2prompt-1.1.0/src/main.rs:198:50:
Failed to copy output to clipboard: XcbConnect(DisplayParsingError)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[1] 60390 IOT instruction (core dumped) code2prompt src
The arboard::Clipboard
functionality in main.rs
is causing issues. To resolve this, we need to remove the related lines of code and recompile the project.
Remove the following lines from main.rs
:
use arboard::Clipboard;
...
let mut clipboard = Clipboard::new().expect("Failed to initialize clipboard");
clipboard.set_text(rendered).expect("Failed to copy output to clipboard");
println!(
"{}{}{} {}",
"[".bold().white(),
"✓".bold().green(),
"]".bold().white(),
"Prompt copied to clipboard!".green()
);
Recompile the project:
cargo build --release
@AnirudhRahul I implemented the --no-clipboard
option in #20. If you are on a remote machine, I'm able to use it using the --output
flag.
Fixed in #20 by @ODAncona! 🙌 🎉
Could a flag be added to skip copying the output to clipboard so code2prompt can be used on a remote without a clipboard.