Skip to content

write_clip() adds some character #68

Description

@TanguyBarthelemy

I try to use write_clip() with some string.
When I call read_clip(), I get different results without changing the clipboard value:

library("clipr")
#> Welcome to clipr. See ?write_clip for advisories on writing to the clipboard in R.

write_clip("plot(AirPassengers)", allow_non_interactive = TRUE)
read_clip(allow_non_interactive = TRUE)
#> [1] "plot(AirPassengers)" "爀役慤慴慢敳"
read_clip(allow_non_interactive = TRUE)
#> [1] "plot(AirPassengers)" "嘀翶"
read_clip(allow_non_interactive = TRUE)
#> [1] "plot(AirPassengers)"
read_clip(allow_non_interactive = TRUE)
#> [1] "plot(AirPassengers)"                                     "爀浡≳嬺〳㤶ⱝ煚⩩退㈵㌷ㄹ〲昭㘰ⴶ搴愹愭㈰ⵢ㘵㔶〶昹ㄱ昵䔀)"

Also if I call utils::readClipboard(), I get the same results.

However, when I just paste the results with Ctrl + v (on Windows), every time I get plot(AirPassengers) with a new line (the expected result).

Also when I copy by hand and use read_clip(), I never get the additionnal character...

Thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions