fix: ANSI escape codes with --watch #3884

The escape code should be \033, but that doesn't work in strict mode, probably because of that it was changed to \\033 which isn't valid either.
This commit is contained in:
Tanel 2019-05-07 10:10:56 +03:00 committed by GitHub
parent 2833774d7f
commit a5dc8fa7ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -589,8 +589,8 @@ class API {
if (opts && opts.rawArgs && opts.rawArgs.indexOf('--watch') > -1) {
var moment = require('moment');
function show() {
process.stdout.write('\\033[2J');
process.stdout.write('\\033[0f');
process.stdout.write('\x1b[2J');
process.stdout.write('\x1b[0f');
console.log('Last refresh: ', moment().format('LTS'));
that.Client.executeRemote('getMonitorData', {}, function(err, list) {
UX.dispAsTable(list, null);