The Shell module allows you to interact with the shell and processes
Members
-
require("ko/shell").spawn
-
Alias for run
Methods
-
require("ko/shell").exec(command, opts, callback)
-
Execute an encoded command
Example
opts = { cwd:"", // set current working dir. Default to Place Pane root env:{}, // object containing current system variables including ones set in Komodo prefs argv:[], // an array or arugments to be passed to the command runIn: "", // Where to out stdout. eg. "hud" }Parameters:
Name Type Description commandString The command to execute
optsObject Options object
callbackfunction The callback function. When called it will have the following 3 arguments:
errorError,stdoutString | Buffer,stderrString | Buffer.Returns:
- Type
- Process
-
require("ko/shell").getCwd()
-
Get the current working directory, based on the places pane
Returns:
- Type
- String
-
require("ko/shell").getEnv()
-
Get the configured environment variables
Returns:
- Type
- Object
-
require("ko/shell").lookup(command, env)
-
Look up the location of the given executable
Parameters:
Name Type Description commandString The executable
envObject The environment to work with, defaults to getEnv()
Returns:
- Type
- String | Boolean
-
require("ko/shell").parseTable()
-
Parses table information into a JS array
Example:
FOO BAR val1a val2a val1b val2a
Results in:
[ {FOO: val1a, BAR: val2a}, {FOO: val1b, BAR: val2b} ]
Returns:
- Type
- Array
-
require("ko/shell").run(binary, args, opts)
-
Run a shell command
Example
opts = { cwd:"", // set current working dir. Default to Place Pane root env:{}, // object containing current system variables including ones set in Komodo prefs }Parameters:
Name Type Description binaryString Executable
argsArray Arguments
optsObject cwd, env, ..
Returns:
- Type
- Process
-
require("ko/shell")._showOutputInHud(process, command)
-
Show output for the given process in a HUD window
Parameters:
Name Type Description processProcess The process to show output for
commandString The (humanly readable) command that was used to start this process