function wrap (proto, name) {
  var old = proto[name];

  proto[name] = function () {
    if (global.repl) global.repl.bufferStart();
    var args = slice(arguments);
    var last = args[args.length-1];
    if ('function' == typeof last) {
      args[args.length-1] = function () {
        if (global.repl) global.repl.bufferEnd()
        if (p != last) console.log();
        last.apply(null, arguments)
        if (global.repl) {
          global.repl.displayPrompt();
          global.repl.moveCursorToEnd();
        }
      }
    } else {
      args.push(function () {
        if (global.repl) global.repl.bufferEnd()
        p.apply(null, arguments);
        if (global.repl) global.repl.moveCursorToEnd();
      });
    }
    old.apply(this, args);
  }

  if (old.help) {
    proto[name].help = old.help;
  }
}
function wrap (proto, name) {
  var old = proto[name];

  proto[name] = function () {
    if (global.repl) global.repl.bufferStart();
    var args = slice(arguments);
    var last = args[args.length-1];
    if ('function' == typeof last) {
      args[args.length-1] = function () {
        if (global.repl) global.repl.bufferEnd()
        if (p != last) console.log();
        last.apply(null, arguments)
        if (global.repl) {
          global.repl.displayPrompt();
          global.repl.moveCursorToEnd();
        }
      }
    } else {
      args.push(function () {
        if (global.repl) global.repl.bufferEnd()
        p.apply(null, arguments);
        if (global.repl) global.repl.moveCursorToEnd();
      });
    }
    old.apply(this, args);
  }

  if (old.help) {
    proto[name].help = old.help;
  }
}
function wrap ( proto , name ) { var old = proto [ name ] ; proto [ name ] = function ( ) { if ( global . repl ) global . repl . bufferStart ( ) ; var args = slice ( arguments ) ; var last = args [ args . length - 1 ] ; if ( 'function' == typeof last ) { args [ args . length - 1 ] = function ( ) { if ( global . repl ) global . repl . bufferEnd ( ) if ( p != last ) console . log ( ) ; last . apply ( null , arguments ) if ( global . repl ) { global . repl . displayPrompt ( ) ; global . repl . moveCursorToEnd ( ) ; } } } else { args . push ( function ( ) { if ( global . repl ) global . repl . bufferEnd ( ) p . apply ( null , arguments ) ; if ( global . repl ) global . repl . moveCursorToEnd ( ) ; } ) ; } old . apply ( this , args ) ; } if ( old . help ) { proto [ name ] . help = old . help ; } }
Wrap async functions with animation etc
Wrap async functions with animation etc