LocalProcess
public class LocalProcess
                This class provides the capabilities to launch a local Unix process, and connect it to a Terminal
 class or subclass.
The MacLocalTerminalView is an example of this, it is a subclass of the
 MacTerminalView NSView, and it connects that view to the local system, providing a complete
 terminal emulator connected to running local commands.
When you create an instance of LocalProcess, you provide a delegate that is used to notify
 your application when data is received from the lcoal process, to request the desired window size
 that you would like to give to the child process, and when the process terminates.
Once you create this instance, you can start a child process by calling the startProcess method
 which will start the process.   You can then send data to this underlying process using the
 send(data:) method, and you will receive the output on the provided delegate with the
 dataReceived(slice:) method.
Received data is dispatched via the queue that you provide in the LocalProcess constructor, if none
 is provided, this will default to DispatchQueue.main.  Generally, this is a good default, but if you
 have your own main loop or a different dispatching system, you will need to pass your own (for example,
 the HeadlessTerminal implementation in the test suite does this.
- 
                  
                  
Undocumented
Declaration
Swift
public private(set) var childfd: Int32 { get } - 
                  
                  
Initializes the LocalProcess runner and communication with the host happens via the provided
LocalProcessDelegateinstance.Declaration
Swift
public init(delegate: LocalProcessDelegate, dispatchQueue: DispatchQueue? = nil)Parameters
delegatethe delegate that will receive events or request data from your application
dispatchQueuethis is the queue that will be used to post data received from the child process when calling the
send(dataReceived:)delegate method. If the value provided isnil, then this will default toDispatchQueue.main - 
                  
                  
Sends the array slice to the local process using DispatchIO
Declaration
Swift
public func send(data: ArraySlice<UInt8>)Parameters
dataThe range of bytes to send to the child process
 - 
                  
                  
Indicates if the child process is currently running
Declaration
Swift
public private(set) var running: Bool { get } - 
                  
                  
Launches a child process inside a pseudo-terminal
Declaration
Swift
public func startProcess(executable: String = "/bin/bash", args: [String] = [], environment: [String]? = nil, execName: String? = nil)Parameters
executableThe executable to launch inside the pseudo terminal, defaults to /bin/bash
argsan array of strings that is passed as the arguments to the underlying process
environmentan array of environment variables to pass to the child process, if this is null, this picks a good set of defaults from
Terminal.getEnvironmentVariables.execNameIf provided, this is used as the Unix argv[0] parameter, otherwise, the executable is used as the args [0], this is used when the intent is to set a different process name than the file that backs it.
 - 
                  
                  
Use this method to toggle the logging of data coming from the host, or pass nil to stop
Declaration
Swift
public func setHostLogging(directory: String?)Parameters
directorylocation where the log files will be stored.
 
View on GitHub
Install in Dash
        LocalProcess Class Reference