Skip to content

Commit 0442009

Browse files
authored
Update clipboard.ts
Use simple pipe approach for Linux instead of temp file
1 parent e179460 commit 0442009

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/utils/clipboard.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@ function getClipboardTextCommand(
115115
"`\""
116116
)}\\""`;
117117
case "linux":
118-
return `xclip -selection clipboard -in <<< "${text.replace(
119-
/"/g,
120-
"\\\""
121-
)}"`;
118+
return `echo "${text.replace(/"/g, "\\\"")}" | xclip -selection clipboard`;
122119
default:
123120
return null;
124121
}

0 commit comments

Comments
 (0)