diff --git a/src/index.ts b/src/index.ts index 91c698f..82355d4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,7 +6,7 @@ import * as os from 'os'; import { Terminal as BaseTerminal } from './terminal'; import { ITerminal, IPtyOpenOptions, IPtyForkOptions } from './interfaces'; -import { ArgvOrCmdline } from './types'; +import { ArgvOrCommandLine } from './types'; let Terminal: any; if (os.platform() === 'win32') { @@ -26,17 +26,17 @@ if (os.platform() === 'win32') { * @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx * @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx */ -export function spawn(file?: string, args?: ArgvOrCmdline, opt?: IPtyForkOptions): ITerminal { +export function spawn(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions): ITerminal { return new Terminal(file, args, opt); }; /** @deprecated */ -export function fork(file?: string, args?: ArgvOrCmdline, opt?: IPtyForkOptions): ITerminal { +export function fork(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions): ITerminal { return new Terminal(file, args, opt); }; /** @deprecated */ -export function createTerminal(file?: string, args?: ArgvOrCmdline, opt?: IPtyForkOptions): ITerminal { +export function createTerminal(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions): ITerminal { return new Terminal(file, args, opt); }; diff --git a/src/types.ts b/src/types.ts index b199369..cb20756 100644 --- a/src/types.ts +++ b/src/types.ts @@ -2,4 +2,4 @@ * Copyright (c) 2017, Daniel Imms (MIT License). */ -export type ArgvOrCmdline = string[] | string; +export type ArgvOrCommandLine = string[] | string; diff --git a/src/unixTerminal.ts b/src/unixTerminal.ts index 2890693..44c42cb 100644 --- a/src/unixTerminal.ts +++ b/src/unixTerminal.ts @@ -8,7 +8,7 @@ import * as path from 'path'; import * as tty from 'tty'; import { Terminal } from './terminal'; import { ProcessEnv, IPtyForkOptions, IPtyOpenOptions } from './interfaces'; -import { ArgvOrCmdline } from './types'; +import { ArgvOrCommandLine } from './types'; import { assign } from './utils'; const pty = require(path.join('..', 'build', 'Release', 'pty.node')); @@ -32,7 +32,7 @@ export class UnixTerminal extends Terminal { private master: any; private slave: any; - constructor(file?: string, args?: ArgvOrCmdline, opt?: IPtyForkOptions) { + constructor(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions) { super(); if (typeof args === 'string') { diff --git a/src/windowsPtyAgent.ts b/src/windowsPtyAgent.ts index bc084c9..2a21de6 100644 --- a/src/windowsPtyAgent.ts +++ b/src/windowsPtyAgent.ts @@ -5,7 +5,7 @@ import * as net from 'net'; import * as path from 'path'; -import { ArgvOrCmdline } from './types'; +import { ArgvOrCommandLine } from './types'; const pty = require(path.join('..', 'build', 'Release', 'pty.node')); @@ -32,7 +32,7 @@ export class WindowsPtyAgent { constructor( file: string, - args: ArgvOrCmdline, + args: ArgvOrCommandLine, env: string[], cwd: string, cols: number, @@ -43,10 +43,10 @@ export class WindowsPtyAgent { cwd = path.resolve(cwd); // Compose command line - const cmdline = argsToCommandLine(file, args); + const commandLine = argsToCommandLine(file, args); // Open pty session. - const term = pty.startProcess(file, cmdline, env, cwd, cols, rows, debug); + const term = pty.startProcess(file, commandLine, env, cwd, cols, rows, debug); // Terminal pid. this._pid = term.pid; @@ -90,7 +90,7 @@ export class WindowsPtyAgent { // Convert argc/argv into a Win32 command-line following the escaping convention // documented on MSDN (e.g. see CommandLineToArgvW documentation). Copied from // winpty project. -export function argsToCommandLine(file: string, args: ArgvOrCmdline): string { +export function argsToCommandLine(file: string, args: ArgvOrCommandLine): string { if (isCommandLine(args)) { if (args.length === 0) { return file; @@ -137,7 +137,7 @@ export function argsToCommandLine(file: string, args: ArgvOrCmdline): string { return result; } -function isCommandLine(args: ArgvOrCmdline): args is string { +function isCommandLine(args: ArgvOrCommandLine): args is string { return typeof args === 'string'; } diff --git a/src/windowsTerminal.ts b/src/windowsTerminal.ts index 94c85fb..0d3847b 100644 --- a/src/windowsTerminal.ts +++ b/src/windowsTerminal.ts @@ -9,7 +9,7 @@ import { inherits } from 'util'; import { Terminal } from './terminal'; import { WindowsPtyAgent } from './windowsPtyAgent'; import { IPtyForkOptions, IPtyOpenOptions } from './interfaces'; -import { ArgvOrCmdline } from './types'; +import { ArgvOrCommandLine } from './types'; import { assign } from './utils'; const DEFAULT_FILE = 'cmd.exe'; @@ -20,7 +20,7 @@ export class WindowsTerminal extends Terminal { private deferreds: any[]; private agent: WindowsPtyAgent; - constructor(file?: string, args?: ArgvOrCmdline, opt?: IPtyForkOptions) { + constructor(file?: string, args?: ArgvOrCommandLine, opt?: IPtyForkOptions) { super(); // Initialize arguments