diff --git a/src/interfaces.ts b/src/interfaces.ts index bf20a89d8..22faa8ea2 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -59,7 +59,7 @@ export interface ITerminal { /** * Set the pty socket encoding. */ - setEncoding(encoding: string): void; + setEncoding(encoding: string | null): void; /** * Resume the pty socket. diff --git a/src/terminal.ts b/src/terminal.ts index 22bc6bf2b..fb7f60908 100644 --- a/src/terminal.ts +++ b/src/terminal.ts @@ -124,7 +124,7 @@ export abstract class Terminal implements ITerminal { } /** See net.Socket.setEncoding */ - public setEncoding(encoding: string): void { + public setEncoding(encoding: string | null): void { if ((this._socket)._decoder) { delete (this._socket)._decoder; } diff --git a/typings/node-pty.d.ts b/typings/node-pty.d.ts index d7a45db57..7382794d8 100644 --- a/typings/node-pty.d.ts +++ b/typings/node-pty.d.ts @@ -50,7 +50,7 @@ declare module 'node-pty' { * If unset, incoming data will be delivered as raw bytes (Buffer type). * By default 'utf8' is assumed, to unset it explicitly set it to `null`. */ - encoding?: string; + encoding?: string | null; /** * Whether to enable flow control handling (false by default). If enabled a message of `flowControlPause`