Adding colors to terminal prompt results in large white space
I'm working on a simple cli script and wanted to add some color to the following code: rl.question('Enter destination path: ', function(answer) { // ... }); rl.write('/home/' + user + '/bin'); Which displays in the terminal: Enter destination path: /home/jmcateer/bin_ But I wanted to add some color to the prompt I did the following: rl.question('\u001b[1;36mEnter destination path:\u001b[0m ', function(answer) { }); rl.write('/home/' + user + '/bin'); And the command line prompt ended up displaying: Enter destination path: /home/jmcateer/bin_ It works but there's a huge amount of white space I