From a3b4568a76ca559e70e615b247e9d816facec149 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 27 Jun 2016 23:07:59 -0600 Subject: [PATCH] Fix issue parsing args in sgr() introduced recently --- core/ansi_term.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/ansi_term.js b/core/ansi_term.js index c0bf37e8..869768b9 100644 --- a/core/ansi_term.js +++ b/core/ansi_term.js @@ -354,13 +354,14 @@ function sgr() { let result = []; const args = Array.isArray(arguments[0]) ? arguments[0] : arguments; - args.forEach(arg => { + for(let i = 0; i < args.length; ++i) { + const arg = args[i]; if(_.isString(arg) && arg in SGRValues) { result.push(SGRValues[arg]); } else if(_.isNumber(arg)) { result.push(arg); } - }); + } return `${ESC_CSI}${result.join(';')}m`; }