Permalink
Browse files

document detach operator and the `jobs` command

  • Loading branch information...
substack committed Nov 19, 2013
1 parent a2b3189 commit 3142c18fa83d287bc7e879e85ec8e800fa5e4007
Showing with 19 additions and 3 deletions.
  1. +1 −1 index.js
  2. +18 −2 readme.markdown
View
@@ -424,7 +424,7 @@ Bash.prototype.eval = function (line) {
self.emit('done', index, cmd);
});
})(cmd);
- self.emit('job', cmd);
+ self.emit('detach', cmd);
if (commands.length) {
cmd = shiftCommand();
}
View
@@ -116,13 +116,30 @@ Just before a file is read, this event fires.
Just before a file is written to, this event fires.
+## bash.on('detach', function (index, cmd) {})
+
+When a process gets detached (with the `&` operator), this event fires with the
+job `index` and the process reference or stream object `cmd`.
+
+You can also check the `cmd.command` and `cmd.arguments` to get the command and
+arguments of the original invocation.
+
+## bash.on('done', function (index, cmd) {})
+
+When a detached process exits, this event fires with the job `index` and the
+process reference or stream object `cmd`.
+
+You can also check the `cmd.command` and `cmd.arguments` to get the command and
+arguments of the original invocation.
+
# status
The scope of this module is to only support the internally-defined bash
functions you can list by typing `help` in a real bash shell.
## implemented
+* `job_spec [&]`
* `&&`, `;`, `||`, `|`, `<`, `>`
* `$?`
* `cd [-L|[-P [-e]]] [dir]`
@@ -131,12 +148,12 @@ functions you can list by typing `help` in a real bash shell.
* `exit [n]`
* `false`
* `filename [arguments]`
+* `jobs [-lnprs] [jobspec ...] or jobs >`
* `pwd [-LP]`
* `true`
## not yet implemented
-* `job_spec [&]`
* `(( expression ))`
* `. filename [arguments]`
* `:`
@@ -171,7 +188,6 @@ functions you can list by typing `help` in a real bash shell.
* `help [-dms] [pattern ...]`
* `history [-c] [-d offset] [n] or hist>`
* `if COMMANDS; then COMMANDS; [ elif C>`
-* `jobs [-lnprs] [jobspec ...] or jobs >`
* `kill [-s sigspec | -n signum | -sigs>`
* `let arg [arg ...]`
* `local [option] name[=value] ...`

0 comments on commit 3142c18

Please sign in to comment.