Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

nearly passing the jobs test with a bgdata backchannel hack

  • Loading branch information...
commit 45a16e04bcdf00660480a8c452e901792c5a45bf 1 parent 48277d6
@substack authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 index.js
View
6 index.js
@@ -277,6 +277,9 @@ Bash.prototype.createStream = function () {
var closed = false;
var output = resumer();
+ self.on('bgdata', function (buf) {
+ output.queue(buf);
+ });
output.queue(self.getPrompt());
self.current = null;
@@ -419,6 +422,9 @@ Bash.prototype.eval = function (line) {
var index = self._jobIndex();
self.jobs[index] = cmd;
(function (cmd, index) {
+ cmd.on('data', function (buf) {
+ self.emit('bgdata', buf);
+ });
cmd.on('end', function () {
delete self.jobs[index];
self.emit('done', index, cmd);
Please sign in to comment.
Something went wrong with that request. Please try again.