TerminalView
public class TerminalView : NSView, NSTextInputClient, NSUserInterfaceValidations
extension TerminalView: TerminalDelegate
TerminalView provides an AppKit front-end to the Terminal
termininal emulator.
It is up to a subclass to either wire the terminal emulator to a remote terminal
via some socket, to an application that wants to run with terminal emulation, or
wiring this up to a pseudo-terminal.
Users are notified of interesting events in their implementation of the TerminalViewDelegate
methods - an instance must be provided to the constructor of TerminalView
.
-
By default this uses grey on top of black, but if you want to use system colors change this global. This likely needs to be configured via another system that does not currently exist
Declaration
Swift
public static var useSystemColors: Bool
-
Undocumented
Declaration
Swift
public override init(frame: CGRect)
-
Undocumented
Declaration
Swift
public required init?(coder: NSCoder)
-
Returns the underlying terminal emulator that the
TerminalView
is a view forDeclaration
Swift
public func getTerminal() -> Terminal
-
The delegate that the TerminalView uses to interact with its hosting
Declaration
Swift
public weak var delegate: TerminalViewDelegate?
-
Undocumented
Declaration
Swift
public var optionAsMetaKey: Bool
-
Declaration
Swift
public func bell(source: Terminal)
-
Declaration
Swift
public func bufferActivated(source: Terminal)
-
Declaration
Swift
public func send(source: Terminal, data: ArraySlice<UInt8>)
-
Given the current set of columns and rows returns a frame that would host this control.
Declaration
Swift
public func getOptimalFrameSize() -> NSRect
-
Declaration
Swift
public func scrolled(source terminal: Terminal, yDisp: Int)
-
Declaration
Swift
public func linefeed(source: Terminal)
-
Returns the thumb size in proportion to the visible content of the entire content, alternate buffers are not scrollable, so this returns 0
Declaration
Swift
public var scrollThumbsize: CGFloat { get }
-
Gets a value indicating the relative position of the terminal viewport
Declaration
Swift
public var scrollPosition: Double { get }
-
Gets a value indicating whether or not the user can scroll the terminal contents Declaration
Swift
public var canScroll: Bool { get }
-
Undocumented
Declaration
Swift
public func scroll(toPosition: Double)
-
Scrolls the content of the terminal one page up
Declaration
Swift
public func pageUp()
-
Scrolls the content of the terminal one page down
Declaration
Swift
public func pageDown()
-
Scrolls up the content of the terminal the specified number of lines
Declaration
Swift
public func scrollUp(lines: Int)
-
Scrolls down the content of the terminal the specified number of lines
Declaration
Swift
public func scrollDown(lines: Int)
-
Undocumented
Declaration
Swift
override public func draw(_ dirtyRect: NSRect)
-
Undocumented
Declaration
Swift
public func feed(text: String)
-
Undocumented
Declaration
Swift
public override func cursorUpdate(with event: NSEvent)
-
Undocumented
Declaration
Swift
public override var frame: NSRect { get set }
-
Triggers a resize of the underlying terminal to the desired columsn and rows
Declaration
Swift
public func resize(cols: Int, rows: Int)
-
Undocumented
Declaration
Swift
public override func resize(withOldSuperviewSize oldSize: NSSize)
-
Sends the specified slice of byte arrays to the program running under the terminal emulator
Declaration
Swift
public func send(data: ArraySlice<UInt8>)
Parameters
data
the slice of an array to send to the client
-
Sends the specified string encoded at utf8 to the program running under the terminal emulator
Declaration
Swift
public func send(txt: String)
Parameters
txt
the string to send to the client
-
Sends the specified array of bytes to the program running under the terminal emulator
Declaration
Swift
public func send(_ bytes: [UInt8])
Parameters
bytes
the bytes to send to the client
-
Undocumented
Declaration
Swift
public var hasFocus: Bool { get set }
-
Undocumented
Declaration
Swift
public override func becomeFirstResponder() -> Bool
-
Undocumented
Declaration
Swift
public override func resignFirstResponder() -> Bool
-
Undocumented
Declaration
Swift
public override var acceptsFirstResponder: Bool { get }
-
Undocumented
Declaration
Swift
public override func flagsChanged(with event: NSEvent)
-
Undocumented
Declaration
Swift
public override func mouseExited(with event: NSEvent)
-
Undocumented
Declaration
Swift
public override func keyDown(with event: NSEvent)
-
Undocumented
Declaration
Swift
public override func doCommand(by selector: Selector)
-
Undocumented
Declaration
Swift
public func insertText(_ string: Any, replacementRange: NSRange)
-
Undocumented
Declaration
Swift
public func setMarkedText(_ string: Any, selectedRange: NSRange, replacementRange: NSRange)
-
Undocumented
Declaration
Swift
public func unmarkText()
-
Undocumented
Declaration
Swift
public func selectedRange() -> NSRange
-
Undocumented
Declaration
Swift
public func markedRange() -> NSRange
-
Undocumented
Declaration
Swift
public func hasMarkedText() -> Bool
-
Undocumented
Declaration
Swift
public func attributedSubstring(forProposedRange range: NSRange, actualRange: NSRangePointer?) -> NSAttributedString?
-
Undocumented
Declaration
Swift
public func validAttributesForMarkedText() -> [NSAttributedString.Key]
-
Undocumented
Declaration
Swift
public func firstRect(forCharacterRange range: NSRange, actualRange: NSRangePointer?) -> NSRect
-
Undocumented
Declaration
Swift
public func characterIndex(for point: NSPoint) -> Int
-
Undocumented
Declaration
Swift
public func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool
-
Declaration
Swift
public func selectionChanged(source: Terminal)
-
Undocumented
Declaration
Swift
@objc public func paste(_ sender: Any)
-
Undocumented
Declaration
Swift
@objc public func copy(_ sender: Any)
-
Undocumented
Declaration
Swift
public override func selectAll(_ sender: Any?)
-
Undocumented
Declaration
Swift
public override func mouseDown(with event: NSEvent)
-
Undocumented
Declaration
Swift
public override func mouseUp(with event: NSEvent)
-
Undocumented
Declaration
Swift
public override func mouseDragged(with event: NSEvent)
-
Undocumented
Declaration
Swift
public override func mouseMoved(with event: NSEvent)
-
Undocumented
Declaration
Swift
public override func scrollWheel(with event: NSEvent)
-
Undocumented
Declaration
Swift
public override func resetCursorRects()
-
Declaration
Swift
public func isProcessTrusted(source: Terminal) -> Bool
-
Declaration
Swift
public func mouseModeChanged(source: Terminal)
-
Undocumented
Declaration
Swift
public func showCursor(source: Terminal)
-
Declaration
Swift
public func setTerminalTitle(source: Terminal, title: String)
-
Declaration
Swift
public func sizeChanged(source: Terminal)
-
Declaration
Swift
public func setTerminalIconTitle(source: Terminal, title: String)
-
Declaration