Permalink
Browse files

fix for setting the exit index properly

  • Loading branch information...
1 parent 2961ef8 commit b7bcfcd400255486d79829ee16f3b90a283cc3af @substack committed Nov 20, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 index.js
View
@@ -418,12 +418,12 @@ Bash.prototype.eval = function (line) {
else if (op === '&') {
var index = self._jobIndex();
self.jobs[index] = cmd;
- (function (cmd) {
+ (function (cmd, index) {
cmd.on('end', function () {
delete self.jobs[index];
self.emit('done', index, cmd);
});
- })(cmd);
+ })(cmd, index);
self.emit('detach', cmd);
if (commands.length) {
cmd = shiftCommand();

0 comments on commit b7bcfcd

Please sign in to comment.