Permalink
Browse files

nearly passing the jobs test with a bgdata backchannel hack

  • Loading branch information...
1 parent 48277d6 commit 45a16e04bcdf00660480a8c452e901792c5a45bf @substack committed Nov 24, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 index.js
View
@@ -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);

0 comments on commit 45a16e0

Please sign in to comment.