瀏覽代碼

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

Christian Kahlau 1 年之前
父節點
當前提交
714262d23b
共有 1 個文件被更改,包括 1 次插入1 次删除
  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, ' ');