I love clipr::write_clip but I've noticed every time I write something to the clipboard with it, there is always a newline following it. Here's some sample code:
install.packages("clipr")
library(clipr)
text = "Hello world"
clipr::write_clip(text)
result = "Hello world
"
As you can see, when I paste the result into a set of quotation marks there is a pesky newline. Ideally when I paste the result into a set of quotes it would look like this:
result = "Hello world"
I've dug through the documentation at https://www.rdocumentation.org/packages/clipr/versions/0.8.0/topics/write_clip and tried different settings for breaks and eos, but so far no luck. The description of eos says "The terminator to be written after each string, followed by an ASCII nul." and I think the ASCII nul is causing my problem here, does anyone know a way to get rid of it?
Thank you!
Hard to replicate, because:
Created on 2024-02-29 with reprex v2.1.0
Please note,
allow_non_interactive = TRUEis just for reprex to be able to execute in background, it doesn't influence the results.