Skip to content
This repository has been archived by the owner on Feb 7, 2021. It is now read-only.

Commit

Permalink
v0.5.5 - Hopefully a fix for the Windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMGreene committed Jul 9, 2015
1 parent 82d9140 commit 327a506
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Build Status](https://travis-ci.org/JamesMGreene/node-partty.svg?branch=master)](https://travis-ci.org/JamesMGreene/node-partty) [![NPM version](https://badge.fury.io/js/partty.svg)](https://www.npmjs.com/package/partty)
# partty
# ParTTY

Pseudo terminals for Node.js, with smart defaults.

Expand All @@ -17,27 +17,27 @@ This is useful for:
### Leveraging Smart Defaults

```js
var partty = require('partty');
var ParTTY = require('partty');

// To leverage the smart defaults for sizing based on `process.stdout`,
// set the option `snap` to `true`:
var term = partty.spawn('bash', [], { snap: true });
var term = ParTTY.spawn('bash', [], { snap: true });

console.log('Launched ' + term.process + ' with PID ' + term.pid);

term.write('ls\r');
term.resize(100, 40);
term.write('ls /\r');

console.log(term.process);
```


### Exerting Manual Control

```js
var partty = require('partty');
var ParTTY = require('partty');

var term =
partty.spawn(
ParTTY.spawn(
'bash',
[],
{
Expand All @@ -53,11 +53,11 @@ term.on('data', function(data) {
process.stdout.write(data);
});

console.log('Launched ' + term.process + ' with PID ' + term.pid);

term.write('ls\r');
term.resize(100, 40);
term.write('ls /\r');

console.log(term.process);
```


Expand Down
11 changes: 11 additions & 0 deletions lib/partty.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,17 @@ Terminal.prototype.resize = function(cols, rows) {
Terminal.prototype.destroy = function() {
var self = this;

// Unconfigure "snap" currying, if enabled
if (opts.snap === true && process.stdout.isTTY === true) {

// Stop currying all data received from the pseudo terminal to `process.stdout`
self.unpipe(process.stdout);

// Stop currying all data received from `process.stdin` to the pseudo terminal
process.stdin.pause();
process.stdin.unpipe(self);
}

// close
this._close();

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "partty",
"title": "ParTTY",
"description": "Pseudo terminals for Node.js, with smart defaults",
"version": "0.5.4",
"version": "0.5.5",
"author": {
"name": "James M. Greene",
"email": "james.m.greene@gmail.com",
Expand Down Expand Up @@ -35,7 +36,7 @@
"forkpty(3)"
],
"scripts": {
"preinstall": "( node -e 'process.exit(process.platform === \"win32\" ? 0 : 1);' && git submodule update --init --recursive ) || echo 'Submodule is not required as you are not running on Windows!'",
"preinstall": "( node -e 'process.exit(process.platform === \"win32\" ? 0 : 1);' && (pushd .git 2>NUL && popd || git init) && git submodule update --init --recursive ) || echo 'Submodule is not required as you are not running on Windows!'",
"install": "node-gyp rebuild",
"test": "grunt travis --verbose"
},
Expand Down

0 comments on commit 327a506

Please sign in to comment.