Jelajahi Sumber

top-tty: avoid localized top output (env LC_ALL=C)

Christian Kahlau 1 tahun lalu
induk
melakukan
714262d23b
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      daemon/src/top-tty.ts

+ 1 - 1
daemon/src/top-tty.ts

@@ -23,7 +23,7 @@ export class TopTTY {
   public async runloop() {
     while (true) {
       try {
-        await execTTY('top -d 0.5', { cols: 100, rows: 10 }, (line: string) => {
+        await execTTY('top -d 0.5', { cols: 100, rows: 10, env: { LC_ALL: 'C' } }, (line: string) => {
           if (line.includes('Cpu')) {
             line = line.replace(/\u001b(\[|\()([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGKB]/g, ''); // get rid of tty color format codes
             line = line.replace(/:/g, ' ');