Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShellProcess

Hierarchy

  • TerminalProcess
    • ShellProcess

Index

Constructors

constructor

  • new ShellProcess(options: ShellProcessOptions, processManager: ProcessManager, ringBuffer: MultiRingBuffer, logger: ILogger, environmentUtils: EnvironmentUtils): ShellProcess

Properties

Protected _killed

_killed: boolean

Protected Readonly closeEmitter

closeEmitter: Emitter<IProcessExitEvent>

Protected Readonly errorEmitter

errorEmitter: Emitter<ProcessErrorEvent>

Readonly errorStream

errorStream: DevNullStream

Protected Readonly exitEmitter

exitEmitter: Emitter<IProcessExitEvent>

Readonly id

id: number

Protected Readonly initialCwd

initialCwd: string

Readonly inputStream

inputStream: Writable

Protected Readonly logger

logger: ILogger

Protected Readonly options

options: TerminalProcessOptions

Readonly outputStream

outputStream: MultiRingBufferReadableStream

Protected Readonly processManager

processManager: ProcessManager

Protected Readonly ringBuffer

ringBuffer: MultiRingBuffer

Protected Readonly startEmitter

startEmitter: Emitter<IProcessStartEvent>

Protected Readonly terminal

terminal: undefined | IPty

Protected Readonly type

type: ProcessType

Static Protected defaultCols

defaultCols: number = 80

Static Protected defaultRows

defaultRows: number = 24

Accessors

arguments

  • get arguments(): string[]
  • Returns string[]

executable

  • get executable(): string
  • Returns string

killed

  • get killed(): boolean
  • Returns boolean

onClose

  • get onClose(): Event<IProcessExitEvent>
  • Waits for both process exit and for all the streams to be closed.

    Returns Event<IProcessExitEvent>

onError

  • get onError(): Event<ProcessErrorEvent>
  • Returns Event<ProcessErrorEvent>

onExit

  • get onExit(): Event<IProcessExitEvent>
  • Wait for the process to exit, streams can still emit data.

    Returns Event<IProcessExitEvent>

onStart

  • get onStart(): Event<IProcessStartEvent>
  • Returns Event<IProcessStartEvent>

pid

  • get pid(): number
  • Returns number

Methods

Protected checkTerminal

  • checkTerminal(): void
  • Returns void

createOutputStream

  • createOutputStream(): MultiRingBufferReadableStream
  • Returns MultiRingBufferReadableStream

Protected emitOnClose

  • emitOnClose(code?: number, signal?: string): void
  • Emit the onClose event for this process. Only one of code and signal should be defined.

    Parameters

    • Optional code: number
    • Optional signal: string

    Returns void

Protected emitOnError

  • emitOnError(err: ProcessErrorEvent): void
  • Parameters

    • err: ProcessErrorEvent

    Returns void

Protected emitOnErrorAsync

  • emitOnErrorAsync(error: ProcessErrorEvent): Promise<void>
  • Parameters

    • error: ProcessErrorEvent

    Returns Promise<void>

Protected emitOnExit

  • emitOnExit(code?: number, signal?: string): void
  • Emit the onExit event for this process. Only one of code and signal should be defined.

    Parameters

    • Optional code: number
    • Optional signal: string

    Returns void

Protected emitOnStarted

  • emitOnStarted(): void
  • Returns void

getCwdURI

  • getCwdURI(): Promise<string>
  • Returns Promise<string>

    the current working directory as a URI (usually file:// URI)

Protected handleOnError

  • handleOnError(error: ProcessErrorEvent): void
  • Parameters

    • error: ProcessErrorEvent

    Returns void

Protected handleOnExit

  • handleOnExit(event: IProcessExitEvent): void
  • Parameters

    • event: IProcessExitEvent

    Returns void

Protected isForkOptions

  • isForkOptions(options: any): options is ForkOptions
  • Parameters

    • options: any

    Returns options is ForkOptions

kill

  • kill(signal?: string): void
  • Parameters

    • Optional signal: string

    Returns void

Protected onTerminalExit

  • onTerminalExit(code: undefined | number, signal: undefined | string): void
  • Parameters

    • code: undefined | number
    • signal: undefined | string

    Returns void

resize

  • resize(cols: number, rows: number): void
  • Parameters

    • cols: number
    • rows: number

    Returns void

unregisterProcess

  • unregisterProcess(): void
  • Returns void

write

  • write(data: string): void
  • Parameters

    • data: string

    Returns void

Static getShellExecutableArgs

Static getShellExecutablePath