TerminalViewDelegate
public protocol TerminalViewDelegate : AnyObject
Undocumented
-
The client code sending commands to the terminal has requested a new size for the terminal Applications that support this should call the
TerminalView.getOptimalFrameSizeto get the ideal frame size.This is needed for the rare cases where the remote client request 80 or 132 column displays, it is a rare feature and you most likely can ignore this request.
Declaration
Swift
func sizeChanged(source: TerminalView, newCols: Int, newRows: Int) -
Request to change the title of the terminal.
Declaration
Swift
func setTerminalTitle(source: TerminalView, title: String) -
Invoked when the OSC command 7 for “current directory has changed” command is sent
Declaration
Swift
func hostCurrentDirectoryUpdate(source: TerminalView, directory: String?) -
Request that date be sent to the application running inside the terminal.
Declaration
Swift
func send(source: TerminalView, data: ArraySlice<UInt8>)Parameters
dataSlice of data that should be sent
-
Invoked when the terminal has been scrolled and the new position is provided
Declaration
Swift
func scrolled(source: TerminalView, position: Double)Parameters
positionthe relative position that the code was scrolled to, a value between 0 and 1
-
requestOpenLink(source:Default implementationlink: params: ) Invoked in response to the user clicking on a link, which is most likely a url, but is not mandatory, so custom implementations receive a string, and they can act on this as a way of communciating with the host if desired. The default implementation calls NSWorkspace.shared.open() on the URL.
Default Implementation
Declaration
Swift
func requestOpenLink(source: TerminalView, link: String, params: [String : String])Parameters
sourcethe terminalview that called this method
linkthe string that was encoded as a link by the client application, typically a url, but could be anything, and could be used to communicate by the embedded application and the host
paramsthe specification allows for key/value pairs to be provided, this contains the key and value pairs that were provided
-
bell(source:Default implementation) This method will be invoked when the host beeps.
Default Implementation
Declaration
Swift
func bell(source: TerminalView)
View on GitHub
Install in Dash
TerminalViewDelegate Protocol Reference