Skip to content

Instantly share code, notes, and snippets.

@Evangenieur
Created October 14, 2012 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Evangenieur/3889961 to your computer and use it in GitHub Desktop.
Save Evangenieur/3889961 to your computer and use it in GitHub Desktop.
Bash Wrapper in CoffeeScript + Node.js
spawn = require('child_process').spawn
bash = spawn "bash", ["-i"]
bash.stdin.write "export PS1=wrapped:$PS1\n"
process.stdin.pipe(bash.stdin)
process.stdin.resume()
require('tty').setRawMode(true)
bash.stderr.pipe(process.stderr)
bash.stdout.pipe(process.stdout)
bash.on "exit", ->
require('tty').setRawMode(false)
process.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment