2 * Copyright (c) 2016, Daniel Imms (MIT License).
3 * Copyright (c) 2018, Microsoft Corporation (MIT License).
6 import * as net from 'net';
8 export interface IProcessEnv {
12 export interface ITerminal {
14 * Gets the name of the process.
19 * Gets the process ID.
24 * The socket for the master file descriptor. This is not supported on
30 * The socket for the slave file descriptor. This is not supported on Windows.
35 * Writes data to the socket.
36 * @param data The data to write.
38 write(data: string): void;
42 * @param cols The number of columns.
43 * @param rows The number of rows.
45 resize(cols: number, rows: number): void;
48 * Close, kill and destroy the socket.
54 * @param signal The signal to send, by default this is SIGHUP. This is not
55 * supported on Windows.
57 kill(signal?: string): void;
60 * Set the pty socket encoding.
62 setEncoding(encoding: string | null): void;
65 * Resume the pty socket.
70 * Pause the pty socket.
75 * Alias for ITerminal.on(eventName, listener).
77 addListener(eventName: string, listener: (...args: any[]) => any): void;
80 * Adds the listener function to the end of the listeners array for the event
82 * @param eventName The event name.
83 * @param listener The callback function
85 on(eventName: string, listener: (...args: any[]) => any): void;
88 * Returns a copy of the array of listeners for the event named eventName.
90 listeners(eventName: string): Function[];
93 * Removes the specified listener from the listener array for the event named
96 removeListener(eventName: string, listener: (...args: any[]) => any): void;
99 * Removes all listeners, or those of the specified eventName.
101 removeAllListeners(eventName: string): void;
104 * Adds a one time listener function for the event named eventName. The next
105 * time eventName is triggered, this listener is removed and then invoked.
107 once(eventName: string, listener: (...args: any[]) => any): void;
110 interface IBasePtyForkOptions {
115 env?: { [key: string]: string };
117 handleFlowControl?: boolean;
118 flowControlPause?: string;
119 flowControlResume?: string;
122 export interface IPtyForkOptions extends IBasePtyForkOptions {
127 export interface IWindowsPtyForkOptions extends IBasePtyForkOptions {
129 conptyInheritCursor?: boolean;
132 export interface IPtyOpenOptions {