Closed jul-sh closed 2 weeks ago
It also seems to panic locally for me, it was working fine but at some point started to throw:
2024-07-01 17:09:24.890 code2prompt[9457:68056] -[NSPasteboard _setData:forType:index:usesPboardTypes:] returns false. Type: public.utf8-plain-text, index: 0, object class: __NSCFString.
thread 'main' panicked at /Users/kars/.cargo/registry/src/index.crates.io-6f17d22bba15001f/code2prompt-1.1.0/src/main.rs:198:50:
Failed to copy output to clipboard: "NSPasteboard#writeObjects: returned false"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
On Mac OS 14.5, M2 chip
You can use the --no-clipboard
option if you want a quick workaround
code2prompt v1.1.0 doesn't seem to have --no-clipboard
:
cargo install code2prompt
code2prompt . --no-clipboard
error: unexpected argument '--no-clipboard' found
tip: to pass '--no-clipboard' as a value, use '-- --no-clipboard'
Usage: code2prompt <PATH|--template <TEMPLATE>|--filter <FILTER>|--exclude <EXCLUDE>|--exclude-files <EXCLUDE_FILES>|--exclude-folders <EXCLUDE_FOLDERS>|--tokens|--encoding <ENCODING>|--output <OUTPUT>|--diff|--line-number>
For more information, try '--help'.
It would be great if code2prompt could simply save the content to a temporary file if the clipboard wasn't available.
Quite often I'm using it on a remote server where there is no X system running, often via ssh (e.g. ssh user@host code2prompt ~/git/repo)
this occurs in some setups when using SSH. Instead of panicking, it should still write the output to a file.