Skip to content

Commit

Permalink
Client: Support terminal modes in pty options
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark authored and mscdex committed Jul 7, 2019
1 parent 2283929 commit 83404d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,8 @@ This is a normal **streams2** Duplex Stream (used both by clients and servers),

* **term** - < _string_ > - The value to use for $TERM. **Default:** `'vt100'`

* **modes** - < _object_ > - An object containing [Terminal Modes](#terminal-modes) as keys, with each value set to each mode argument. **Default:** `null`

`rows` and `cols` override `width` and `height` when `rows` and `cols` are non-zero.

Pixel dimensions refer to the drawable area of the window.
Expand Down
5 changes: 4 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,7 @@ function reqPty(chan, opts, cb) {
var width = 640;
var height = 480;
var term = 'vt100';
var modes = null;

if (typeof opts === 'function')
cb = opts;
Expand All @@ -1303,6 +1304,8 @@ function reqPty(chan, opts, cb) {
height = opts.height;
if (typeof opts.term === 'string')
term = opts.term;
if (typeof opts.modes === 'object')
modes = opts.modes;
}

var wantReply = (typeof cb === 'function');
Expand All @@ -1329,7 +1332,7 @@ function reqPty(chan, opts, cb) {
height,
width,
term,
null,
modes,
wantReply);
}

Expand Down

0 comments on commit 83404d8

Please sign in to comment.