Skip to content

Commit

Permalink
fix: xclip process runtime (#12658)
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajkapsz authored Dec 10, 2024
1 parent 0d1eab5 commit 3169593
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-worms-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes astro info copy to clipboard process not returning to prompt in certain cases.
4 changes: 2 additions & 2 deletions packages/astro/src/cli/info/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function copyToClipboard(text: string, force?: boolean) {
// Unix: check if a supported command is installed

const unixCommands: Array<[string, Array<string>]> = [
['xclip', ['-sel', 'clipboard', '-l', '1']],
['xclip', ['-selection', 'clipboard', '-l', '1']],
['wl-copy', []],
];
for (const [unixCommand, unixArgs] of unixCommands) {
Expand Down Expand Up @@ -101,7 +101,7 @@ export async function copyToClipboard(text: string, force?: boolean) {
}

try {
const result = spawnSync(command, args, { input: text });
const result = spawnSync(command, args, { input: text, stdio: ['pipe', 'ignore', 'ignore'] });
if (result.error) {
throw result.error;
}
Expand Down

0 comments on commit 3169593

Please sign in to comment.