diff --git a/index.js b/index.js index 046fae5..8b28573 100755 --- a/index.js +++ b/index.js @@ -55,7 +55,6 @@ if (interactive) { input: process.stdin, output: process.stdout, path: path.join(xdgBasedir.config, "insect-history"), - prompt: '\x1b[01m>>>\x1b[0m ', completer: function(line) { var variables = Object.keys(insectEnv); @@ -76,6 +75,12 @@ if (interactive) { return [keywords, lastWord]; }, next: function(rl) { + var prompt = '\x1b[01m>>>\x1b[0m '; + + // The visual length of the prompt (4) needs to be set explicitly for + // older versions of node: + rl.setPrompt(prompt, 4); + rl.prompt(); rl.on('line', function(line) { diff --git a/package.json b/package.json index bbcb637..2131d68 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "insect", - "version": "4.1.0", + "version": "4.2.0", "description": "REPL-style scientific calculator with full support for physical units", "author": "David Peter ", "license": "MIT",