Skip to content

Commit 944f091

Browse files
committed
fix: correct stdout from null to '' when no output
1 parent d5d8dcc commit 944f091

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

extension/command.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function transformSocketOutput(output: any) {
3232
return output === null
3333
? ''
3434
: Buffer.isBuffer(output)
35-
? decode(output, /* 'utf8' */ 'gb2312')
35+
? decode(output, /* 'utf8' */ 'gb2312') // @todo allow customizing this
3636
: output;
3737
}
3838

@@ -111,9 +111,9 @@ export function executeCommand(command: string, args: string[], stdin?: IOChanne
111111
// If stdout is redirected, resolve `stdout: undefined`
112112
let printed: string | undefined;
113113
if (!stdout)
114-
printed = child.stdout.read();
114+
printed = transformSocketOutput(child.stdout.read());
115115
resolve({
116-
stdout: printed ? transformSocketOutput(printed) : printed,
116+
stdout: printed,
117117
exitCode: child.exitCode!,
118118
duration: Math.round(performance.now() - startTime),
119119
});

src/components/IOPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ async function linkFile() {
3939
<h3>{{ title }}</h3>
4040
<slot name="info" />
4141
<a
42+
v-if="!disabled"
4243
class="link-file"
4344
:title="isLinked ? 'Unlink the file' : 'Link a file'"
4445
:aria-selected="isLinked"
45-
:aria-disabled="disabled"
4646
@click="linkFile"
4747
>
4848
<IconLoadingLoop v-if="isLinking" />

0 commit comments

Comments
 (0)