Skip to content

Commit 843fc17

Browse files
committed
fix: #374
The write part in `CommandCat` was writing a string containing bytes to the terminal. This would make the terminal misinterpret binary data as UTF-formatted data. Converting it back to a buffer fixed this.
1 parent 7ba3a5e commit 843fc17

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/secrets/CommandCat.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ class CommandGet extends CommandPolykey {
119119
}
120120
break;
121121
case 'SuccessMessage':
122-
process.stdout.write(result.secretContent);
122+
process.stdout.write(
123+
Buffer.from(result.secretContent, 'binary'),
124+
);
123125
break;
124126
default:
125127
never(

0 commit comments

Comments
 (0)