Skip to content

Commit

Permalink
Merge pull request #273 from anszom/master
Browse files Browse the repository at this point in the history
Revert "Use a less strict check on encoding to avoid if"
  • Loading branch information
Tyriar authored May 12, 2019
2 parents d5a1ff3 + 1ad0605 commit 4637d85
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/unixTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,21 @@ export class UnixTerminal extends Terminal {

const cols = opt.cols || DEFAULT_COLS;
const rows = opt.rows || DEFAULT_ROWS;
const encoding = opt.encoding ? 'utf8' : opt.encoding;
const encoding = (opt.encoding === undefined ? 'utf8' : opt.encoding);

// open
const term: IUnixOpenProcess = pty.open(cols, rows);

self._master = new PipeSocket(<number>term.master);
self._master.setEncoding(encoding);
if (encoding !== null) {
self._master.setEncoding(encoding);
}
self._master.resume();

self._slave = new PipeSocket(term.slave);
self._slave.setEncoding(encoding);
if (encoding !== null) {
self._slave.setEncoding(encoding);
}
self._slave.resume();

self._socket = self._master;
Expand Down

0 comments on commit 4637d85

Please sign in to comment.