Skip to content

Commit

Permalink
Set platform-specific mode on setClipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
oznogon authored and daid committed Jan 27, 2021
1 parent 599e0fa commit 9960bb9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/clipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ void Clipboard::setClipboard(string value)
#if defined(__linux__) || defined(__APPLE__)
#ifdef __APPLE__
const char* cmd = "/usr/bin/pbcopy > /dev/null 2>&1";
const char* mode = "w";
#else
const char* cmd = "/usr/bin/xclip -i -selection clipboard -silent";
const char* mode = "we";
#endif
FILE* pipe = popen(cmd, "w");
FILE* pipe = popen(cmd, mode);

if (!pipe)
{
Expand Down

0 comments on commit 9960bb9

Please sign in to comment.