Skip to content

Commit

Permalink
fix: correct stdout from null to '' when no output
Browse files Browse the repository at this point in the history
  • Loading branch information
typed-sigterm committed Dec 22, 2024
1 parent d5d8dcc commit 944f091
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions extension/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function transformSocketOutput(output: any) {
return output === null
? ''
: Buffer.isBuffer(output)
? decode(output, /* 'utf8' */ 'gb2312')
? decode(output, /* 'utf8' */ 'gb2312') // @todo allow customizing this
: output;
}

Expand Down Expand Up @@ -111,9 +111,9 @@ export function executeCommand(command: string, args: string[], stdin?: IOChanne
// If stdout is redirected, resolve `stdout: undefined`
let printed: string | undefined;
if (!stdout)
printed = child.stdout.read();
printed = transformSocketOutput(child.stdout.read());
resolve({
stdout: printed ? transformSocketOutput(printed) : printed,
stdout: printed,
exitCode: child.exitCode!,
duration: Math.round(performance.now() - startTime),
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/IOPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ async function linkFile() {
<h3>{{ title }}</h3>
<slot name="info" />
<a
v-if="!disabled"
class="link-file"
:title="isLinked ? 'Unlink the file' : 'Link a file'"
:aria-selected="isLinked"
:aria-disabled="disabled"
@click="linkFile"
>
<IconLoadingLoop v-if="isLinking" />
Expand Down

0 comments on commit 944f091

Please sign in to comment.