code2prompt icon indicating copy to clipboard operation
code2prompt copied to clipboard

Does not copy to clipboard

Open ahonnecke opened this issue 10 months ago • 5 comments

▹▹▹▹▸ Done!                                                                                                                                                               [✓] Prompt copied to clipboard!

However, nothing had been copied to the clipboard. Has this been tested on a linux machine?

ahonnecke avatar Apr 12 '24 18:04 ahonnecke

I can reproduce this when I build it locally as well.

ahonnecke avatar Apr 12 '24 18:04 ahonnecke

Hey @ahonnecke, thank you for opening an issue on this. Can you please send the complete output from code2prompt with --tokens flag used?

mufeedvh avatar Apr 15 '24 13:04 mufeedvh

Hey @mufeedvh , my colleague and I are experiencing the same problem, with both the precompiled and a manually compiled version.

Here's the output from within my local copy of code2prompt.git:

code2prompt --tokens .
▹▹▹▹▸ Done!                                                                                                                                                                                           [i] Token count: 10499, Model info: ChatGPT models, text-embedding-ada-002
[✓] Prompt copied to clipboard!

I'm running Xorg in Ubuntu 23.10.

ngirard avatar Apr 26 '24 13:04 ngirard

Yes having same issue in Ubuntu 20.04 as well.

However absolutely great tool, and Thank You @mufeedvh for open-sourcing it.

rohan-paul avatar Apr 27 '24 19:04 rohan-paul

Hello,

@mufeedvh the problem with Linux clipboard is that the running process is always responsible for providing the copied data, when the process exits, the information is efficiently lost (it's the same as if the clipboard was cleared out). There are workarounds for this problem, see for example the arboard examples, but it is sort of a drag to implement.

RastislavKish avatar Apr 30 '24 21:04 RastislavKish

@RastislavKish Hello, it's fixed in #20 using the use arboard::Clipboard;

ODAncona avatar May 29 '24 07:05 ODAncona

Fixed in #20 by @ODAncona! 🙌 🎉

mufeedvh avatar May 30 '24 02:05 mufeedvh