1

With the Node CLI, I can add this to my shell statup file:

alias node='env NODE_NO_READLINE=1 rlwrap -S "> " node'

When I now run node, I can press the 'up' arrow key and the previous command from the previous session is put on the command prompt. As per this SO answer. See also iojs' history support.

I want to have this functionality with the Babel CLI, but changing the alias from node to babel-node does not change its behaviour.

[EDIT]: I've added this as an issue to Babel on Github.

Community
  • 1
  • 1
Prem
  • 15,911
  • 11
  • 31
  • 35
  • Did you try to add a `rlwrap` option `-a` like this: `alias babel='env NODE_NO_READLINE=1 rlwrap -a -S "> " babel'`. (`man rlwrap` for an explanation) – Hans Lub Jul 08 '15 at 19:39
  • I get `rlwrap: warning: on this system, the getopt() library function doesn't grok optional arguments, so '-S' is taken as an argument to the -a option Is this what you meant? If not, please provide an argument` (osx) – Prem Jul 09 '15 at 22:55
  • When I supply a blank string as the `-a` argument, there's no warning, but history doesn't work. I've got it figured now; I'll add an answer. – Prem Jul 10 '15 at 07:05
  • Scratch that. I didn't figure it out. – Prem Jul 10 '15 at 07:21

0 Answers0