Classes.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Classes Reference</title>
  5. <link rel="stylesheet" type="text/css" href="css/jazzy.css" />
  6. <link rel="stylesheet" type="text/css" href="css/highlight.css" />
  7. <meta charset='utf-8'>
  8. <script src="js/jquery.min.js" defer></script>
  9. <script src="js/jazzy.js" defer></script>
  10. <script src="js/lunr.min.js" defer></script>
  11. <script src="js/typeahead.jquery.js" defer></script>
  12. <script src="js/jazzy.search.js" defer></script>
  13. </head>
  14. <body>
  15. <a name="//apple_ref/swift/Section/Classes" class="dashAnchor"></a>
  16. <a title="Classes Reference"></a>
  17. <header>
  18. <div class="content-wrapper">
  19. <p><a href="index.html">SwiftTerm 1.0 Docs</a> (68% documented)</p>
  20. <p class="header-right"><a href="https://github.com/migueldeicaza/SwiftTerm"><img src="img/gh.png"/>View on GitHub</a></p>
  21. <p class="header-right"><a href="dash-feed://https%3A%2F%2Fmigueldeicaza.github.io%2FSwiftTerm%2Fdocsets%2FSwiftTerm.xml"><img src="img/dash.png"/>Install in Dash</a></p>
  22. <p class="header-right">
  23. <form role="search" action="search.json">
  24. <input type="text" placeholder="Search documentation" data-typeahead>
  25. </form>
  26. </p>
  27. </div>
  28. </header>
  29. <div class="content-wrapper">
  30. <p id="breadcrumbs">
  31. <a href="index.html">SwiftTerm Reference</a>
  32. <img id="carat" src="img/carat.png" />
  33. Classes Reference
  34. </p>
  35. </div>
  36. <div class="content-wrapper">
  37. <nav class="sidebar">
  38. <ul class="nav-groups">
  39. <li class="nav-group-name">
  40. <a href="Classes.html">Classes</a>
  41. <ul class="nav-group-tasks">
  42. <li class="nav-group-task">
  43. <a href="Classes/BufferLine.html">BufferLine</a>
  44. </li>
  45. <li class="nav-group-task">
  46. <a href="Classes/Color.html">Color</a>
  47. </li>
  48. <li class="nav-group-task">
  49. <a href="Classes/HeadlessTerminal.html">HeadlessTerminal</a>
  50. </li>
  51. <li class="nav-group-task">
  52. <a href="Classes/ImageCell.html">ImageCell</a>
  53. </li>
  54. <li class="nav-group-task">
  55. <a href="Classes/LocalProcess.html">LocalProcess</a>
  56. </li>
  57. <li class="nav-group-task">
  58. <a href="Classes/LocalProcessTerminalView.html">LocalProcessTerminalView</a>
  59. </li>
  60. <li class="nav-group-task">
  61. <a href="Classes/PseudoTerminalHelpers.html">PseudoTerminalHelpers</a>
  62. </li>
  63. <li class="nav-group-task">
  64. <a href="Classes/Terminal.html">Terminal</a>
  65. </li>
  66. <li class="nav-group-task">
  67. <a href="Classes/Terminal/MouseMode.html">– MouseMode</a>
  68. </li>
  69. <li class="nav-group-task">
  70. <a href="Classes/Terminal/WindowManipulationCommand.html">– WindowManipulationCommand</a>
  71. </li>
  72. <li class="nav-group-task">
  73. <a href="Classes/Terminal/BufferKind.html">– BufferKind</a>
  74. </li>
  75. <li class="nav-group-task">
  76. <a href="Classes/TerminalAccessory.html">TerminalAccessory</a>
  77. </li>
  78. <li class="nav-group-task">
  79. <a href="Classes/TerminalDebugView.html">TerminalDebugView</a>
  80. </li>
  81. <li class="nav-group-task">
  82. <a href="Classes/TerminalView.html">TerminalView</a>
  83. </li>
  84. <li class="nav-group-task">
  85. <a href="Classes/TerminalView.html">TerminalView</a>
  86. </li>
  87. </ul>
  88. </li>
  89. <li class="nav-group-name">
  90. <a href="Enums.html">Enumerations</a>
  91. <ul class="nav-group-tasks">
  92. <li class="nav-group-task">
  93. <a href="Enums/CursorStyle.html">CursorStyle</a>
  94. </li>
  95. <li class="nav-group-task">
  96. <a href="Enums/ImageSizeRequest.html">ImageSizeRequest</a>
  97. </li>
  98. </ul>
  99. </li>
  100. <li class="nav-group-name">
  101. <a href="Extensions.html">Extensions</a>
  102. <ul class="nav-group-tasks">
  103. <li class="nav-group-task">
  104. <a href="Extensions/TerminalViewDelegate.html">TerminalViewDelegate</a>
  105. </li>
  106. <li class="nav-group-task">
  107. <a href="Extensions/UIImage.html">UIImage</a>
  108. </li>
  109. </ul>
  110. </li>
  111. <li class="nav-group-name">
  112. <a href="Protocols.html">Protocols</a>
  113. <ul class="nav-group-tasks">
  114. <li class="nav-group-task">
  115. <a href="Protocols/LocalProcessDelegate.html">LocalProcessDelegate</a>
  116. </li>
  117. <li class="nav-group-task">
  118. <a href="Protocols/LocalProcessTerminalViewDelegate.html">LocalProcessTerminalViewDelegate</a>
  119. </li>
  120. <li class="nav-group-task">
  121. <a href="Protocols/TerminalDelegate.html">TerminalDelegate</a>
  122. </li>
  123. <li class="nav-group-task">
  124. <a href="Protocols/TerminalImage.html">TerminalImage</a>
  125. </li>
  126. <li class="nav-group-task">
  127. <a href="Protocols/TerminalViewDelegate.html">TerminalViewDelegate</a>
  128. </li>
  129. </ul>
  130. </li>
  131. <li class="nav-group-name">
  132. <a href="Structs.html">Structures</a>
  133. <ul class="nav-group-tasks">
  134. <li class="nav-group-task">
  135. <a href="Structs/Attribute.html">Attribute</a>
  136. </li>
  137. <li class="nav-group-task">
  138. <a href="Structs/Attribute/Color.html">– Color</a>
  139. </li>
  140. <li class="nav-group-task">
  141. <a href="Structs/CharData.html">CharData</a>
  142. </li>
  143. <li class="nav-group-task">
  144. <a href="Structs/CharacterStyle.html">CharacterStyle</a>
  145. </li>
  146. <li class="nav-group-task">
  147. <a href="Structs/TerminalOptions.html">TerminalOptions</a>
  148. </li>
  149. <li class="nav-group-task">
  150. <a href="Structs/TinyAtom.html">TinyAtom</a>
  151. </li>
  152. </ul>
  153. </li>
  154. <li class="nav-group-name">
  155. <a href="Typealiases.html">Type Aliases</a>
  156. <ul class="nav-group-tasks">
  157. <li class="nav-group-task">
  158. <a href="Typealiases.html#/TTImage">TTImage</a>
  159. </li>
  160. <li class="nav-group-task">
  161. <a href="Typealiases.html#/s:9SwiftTerm7TTImagea">TTImage</a>
  162. </li>
  163. </ul>
  164. </li>
  165. </ul>
  166. </nav>
  167. <article class="main-content">
  168. <section>
  169. <section class="section">
  170. <h1>Classes</h1>
  171. <p>The following classes are available globally.</p>
  172. </section>
  173. <section class="section task-group-section">
  174. <div class="task-group">
  175. <ul>
  176. <li class="item">
  177. <div>
  178. <code>
  179. <a name="/c:@M@SwiftTerm@objc(cs)TerminalView"></a>
  180. <a name="//apple_ref/swift/Class/TerminalView" class="dashAnchor"></a>
  181. <a class="token" href="#/c:@M@SwiftTerm@objc(cs)TerminalView">TerminalView</a>
  182. </code>
  183. </div>
  184. <div class="height-container">
  185. <div class="pointer-container"></div>
  186. <section class="section">
  187. <div class="pointer"></div>
  188. <div class="abstract">
  189. <p>TerminalView provides an AppKit front-end to the <code><a href="Classes/Terminal.html">Terminal</a></code> termininal emulator.
  190. It is up to a subclass to either wire the terminal emulator to a remote terminal
  191. via some socket, to an application that wants to run with terminal emulation, or
  192. wiring this up to a pseudo-terminal.</p>
  193. <p>Users are notified of interesting events in their implementation of the <code><a href="Protocols/TerminalViewDelegate.html">TerminalViewDelegate</a></code>
  194. methods - an instance must be provided to the constructor of <code>TerminalView</code>.</p>
  195. <p>Developers might want to surface UIs for <code>optionAsMetaKey</code> and <code>allowMouseReporting</code> in
  196. their application. They both default to true, but this means that Option-Letter is hijacked for
  197. terminal purposes to send the sequence ESC-Letter, instead of the macOS specific character` and
  198. means that when mouse-aware applications are running, they hijack the normal selection process.</p>
  199. <p>Call the <code>getTerminal</code> method to get a reference to the underlying <code><a href="Classes/Terminal.html">Terminal</a></code> that backs this
  200. view.</p>
  201. <p>Use the <code>configureNativeColors()</code> to set the defaults colors for the view to match the OS
  202. defaults, otherwise, this uses its own set of defaults colors.</p>
  203. <a href="Classes/TerminalView.html" class="slightly-smaller">See more</a>
  204. </div>
  205. <div class="declaration">
  206. <h4>Declaration</h4>
  207. <div class="language">
  208. <p class="aside-title">Swift</p>
  209. <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">TerminalView</span> <span class="p">:</span> <span class="kt">NSView</span><span class="p">,</span> <span class="kt">NSTextInputClient</span><span class="p">,</span> <span class="kt">NSUserInterfaceValidations</span></code></pre>
  210. <pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">TerminalView</span><span class="p">:</span> <span class="kt"><a href="Protocols/TerminalDelegate.html">TerminalDelegate</a></span></code></pre>
  211. </div>
  212. </div>
  213. </section>
  214. </div>
  215. </li>
  216. <li class="item">
  217. <div>
  218. <code>
  219. <a name="/s:9SwiftTerm10BufferLineC"></a>
  220. <a name="//apple_ref/swift/Class/BufferLine" class="dashAnchor"></a>
  221. <a class="token" href="#/s:9SwiftTerm10BufferLineC">BufferLine</a>
  222. </code>
  223. </div>
  224. <div class="height-container">
  225. <div class="pointer-container"></div>
  226. <section class="section">
  227. <div class="pointer"></div>
  228. <div class="abstract">
  229. <p>Undocumented</p>
  230. <a href="Classes/BufferLine.html" class="slightly-smaller">See more</a>
  231. </div>
  232. <div class="declaration">
  233. <h4>Declaration</h4>
  234. <div class="language">
  235. <p class="aside-title">Swift</p>
  236. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">BufferLine</span> <span class="p">:</span> <span class="kt">CustomDebugStringConvertible</span></code></pre>
  237. </div>
  238. </div>
  239. </section>
  240. </div>
  241. </li>
  242. <li class="item">
  243. <div>
  244. <code>
  245. <a name="/s:9SwiftTerm9ImageCellC"></a>
  246. <a name="//apple_ref/swift/Class/ImageCell" class="dashAnchor"></a>
  247. <a class="token" href="#/s:9SwiftTerm9ImageCellC">ImageCell</a>
  248. </code>
  249. </div>
  250. <div class="height-container">
  251. <div class="pointer-container"></div>
  252. <section class="section">
  253. <div class="pointer"></div>
  254. <div class="abstract">
  255. <p>Undocumented</p>
  256. <a href="Classes/ImageCell.html" class="slightly-smaller">See more</a>
  257. </div>
  258. <div class="declaration">
  259. <h4>Declaration</h4>
  260. <div class="language">
  261. <p class="aside-title">Swift</p>
  262. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ImageCell</span></code></pre>
  263. </div>
  264. </div>
  265. </section>
  266. </div>
  267. </li>
  268. <li class="item">
  269. <div>
  270. <code>
  271. <a name="/s:9SwiftTerm5ColorC"></a>
  272. <a name="//apple_ref/swift/Class/Color" class="dashAnchor"></a>
  273. <a class="token" href="#/s:9SwiftTerm5ColorC">Color</a>
  274. </code>
  275. </div>
  276. <div class="height-container">
  277. <div class="pointer-container"></div>
  278. <section class="section">
  279. <div class="pointer"></div>
  280. <div class="abstract">
  281. <p>This represents the colors used in SwiftTerm, in particular for cells and backgrounds
  282. in 16-bit RGB mode</p>
  283. <a href="Classes/Color.html" class="slightly-smaller">See more</a>
  284. </div>
  285. <div class="declaration">
  286. <h4>Declaration</h4>
  287. <div class="language">
  288. <p class="aside-title">Swift</p>
  289. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">Color</span> <span class="p">:</span> <span class="kt">Hashable</span></code></pre>
  290. </div>
  291. </div>
  292. </section>
  293. </div>
  294. </li>
  295. <li class="item">
  296. <div>
  297. <code>
  298. <a name="/s:9SwiftTerm16HeadlessTerminalC"></a>
  299. <a name="//apple_ref/swift/Class/HeadlessTerminal" class="dashAnchor"></a>
  300. <a class="token" href="#/s:9SwiftTerm16HeadlessTerminalC">HeadlessTerminal</a>
  301. </code>
  302. </div>
  303. <div class="height-container">
  304. <div class="pointer-container"></div>
  305. <section class="section">
  306. <div class="pointer"></div>
  307. <div class="abstract">
  308. <p>A <code>HeadlessTerminal</code> provides a terminal emulator that runs a local process, but the output does not go
  309. anywhere. You can use this to script applications and screen scrape the output for example, by accessing the
  310. <code>terminal</code> from this class.</p>
  311. <a href="Classes/HeadlessTerminal.html" class="slightly-smaller">See more</a>
  312. </div>
  313. <div class="declaration">
  314. <h4>Declaration</h4>
  315. <div class="language">
  316. <p class="aside-title">Swift</p>
  317. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HeadlessTerminal</span> <span class="p">:</span> <span class="kt"><a href="Protocols/TerminalDelegate.html">TerminalDelegate</a></span><span class="p">,</span> <span class="kt"><a href="Protocols/LocalProcessDelegate.html">LocalProcessDelegate</a></span></code></pre>
  318. </div>
  319. </div>
  320. </section>
  321. </div>
  322. </li>
  323. <li class="item">
  324. <div>
  325. <code>
  326. <a name="/s:9SwiftTerm12LocalProcessC"></a>
  327. <a name="//apple_ref/swift/Class/LocalProcess" class="dashAnchor"></a>
  328. <a class="token" href="#/s:9SwiftTerm12LocalProcessC">LocalProcess</a>
  329. </code>
  330. </div>
  331. <div class="height-container">
  332. <div class="pointer-container"></div>
  333. <section class="section">
  334. <div class="pointer"></div>
  335. <div class="abstract">
  336. <p>This class provides the capabilities to launch a local Unix process, and connect it to a <code><a href="Classes/Terminal.html">Terminal</a></code>
  337. class or subclass.</p>
  338. <p>The <code>MacLocalTerminalView</code> is an example of this, it is a subclass of the
  339. <code>MacTerminalView</code> NSView, and it connects that view to the local system, providing a complete
  340. terminal emulator connected to running local commands.</p>
  341. <p>When you create an instance of <code>LocalProcess</code>, you provide a delegate that is used to notify
  342. your application when data is received from the lcoal process, to request the desired window size
  343. that you would like to give to the child process, and when the process terminates.</p>
  344. <p>Once you create this instance, you can start a child process by calling the <code>startProcess</code> method
  345. which will start the process. You can then send data to this underlying process using the
  346. <code>send(data:)</code> method, and you will receive the output on the provided delegate with the
  347. <code>dataReceived(slice:)</code> method.</p>
  348. <p>Received data is dispatched via the queue that you provide in the LocalProcess constructor, if none
  349. is provided, this will default to <code>DispatchQueue.main</code>. Generally, this is a good default, but if you
  350. have your own main loop or a different dispatching system, you will need to pass your own (for example,
  351. the <code><a href="Classes/HeadlessTerminal.html">HeadlessTerminal</a></code> implementation in the test suite does this.</p>
  352. <a href="Classes/LocalProcess.html" class="slightly-smaller">See more</a>
  353. </div>
  354. <div class="declaration">
  355. <h4>Declaration</h4>
  356. <div class="language">
  357. <p class="aside-title">Swift</p>
  358. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">LocalProcess</span></code></pre>
  359. </div>
  360. </div>
  361. </section>
  362. </div>
  363. </li>
  364. <li class="item">
  365. <div>
  366. <code>
  367. <a name="/c:@M@SwiftTerm@objc(cs)TerminalDebugView"></a>
  368. <a name="//apple_ref/swift/Class/TerminalDebugView" class="dashAnchor"></a>
  369. <a class="token" href="#/c:@M@SwiftTerm@objc(cs)TerminalDebugView">TerminalDebugView</a>
  370. </code>
  371. </div>
  372. <div class="height-container">
  373. <div class="pointer-container"></div>
  374. <section class="section">
  375. <div class="pointer"></div>
  376. <div class="abstract">
  377. <p>Undocumented</p>
  378. <a href="Classes/TerminalDebugView.html" class="slightly-smaller">See more</a>
  379. </div>
  380. <div class="declaration">
  381. <h4>Declaration</h4>
  382. <div class="language">
  383. <p class="aside-title">Swift</p>
  384. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">TerminalDebugView</span> <span class="p">:</span> <span class="kt">NSView</span></code></pre>
  385. </div>
  386. </div>
  387. </section>
  388. </div>
  389. </li>
  390. <li class="item">
  391. <div>
  392. <code>
  393. <a name="/c:@M@SwiftTerm@objc(cs)LocalProcessTerminalView"></a>
  394. <a name="//apple_ref/swift/Class/LocalProcessTerminalView" class="dashAnchor"></a>
  395. <a class="token" href="#/c:@M@SwiftTerm@objc(cs)LocalProcessTerminalView">LocalProcessTerminalView</a>
  396. </code>
  397. </div>
  398. <div class="height-container">
  399. <div class="pointer-container"></div>
  400. <section class="section">
  401. <div class="pointer"></div>
  402. <div class="abstract">
  403. <p><code>LocalProcessTerminalView</code> is an AppKit NSView that can be used to host a local process
  404. the process is launched inside a pseudo-terminal.</p>
  405. <p>Call the <code>startProcess</code> to launch the underlying process inside a pseudo terminal.</p>
  406. <p>Generally, for the <code>LocalProcessTerminalView</code> to be useful, you will want to disable the sandbox
  407. for your application, otherwise the underlying shell will not have access to much - not the majority of
  408. commands, not assorted places on the file systems and so on. For this, you need to disable for your
  409. target in &ldquo;Signing and Capabilities&rdquo; the sandbox entirely.</p>
  410. <p>Note: instances of <code>LocalProcessTerminalView</code> will set the <code><a href="Classes/TerminalView.html">TerminalView</a></code>&lsquo;s <code>delegate</code>
  411. property and capture and consume the messages. The messages that are most likely needed for
  412. consumer applications are reposted to the <code><a href="Protocols/LocalProcessTerminalViewDelegate.html">LocalProcessTerminalViewDelegate</a></code> in
  413. <code>processDelegate</code>. If you override the <code>delegate</code> directly, you might inadvertently break
  414. the internal working of <code>LocalProcessTerminalView</code>. If you must change the <code>delegate</code>
  415. make sure that you proxy the values in your implementation to the values set after initializing this instance</p>
  416. <a href="Classes/LocalProcessTerminalView.html" class="slightly-smaller">See more</a>
  417. </div>
  418. <div class="declaration">
  419. <h4>Declaration</h4>
  420. <div class="language">
  421. <p class="aside-title">Swift</p>
  422. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">LocalProcessTerminalView</span> <span class="p">:</span> <span class="kt"><a href="Classes/TerminalView.html">TerminalView</a></span><span class="p">,</span> <span class="kt"><a href="Protocols/TerminalViewDelegate.html">TerminalViewDelegate</a></span><span class="p">,</span> <span class="kt"><a href="Protocols/LocalProcessDelegate.html">LocalProcessDelegate</a></span></code></pre>
  423. </div>
  424. </div>
  425. </section>
  426. </div>
  427. </li>
  428. <li class="item">
  429. <div>
  430. <code>
  431. <a name="/s:9SwiftTerm21PseudoTerminalHelpersC"></a>
  432. <a name="//apple_ref/swift/Class/PseudoTerminalHelpers" class="dashAnchor"></a>
  433. <a class="token" href="#/s:9SwiftTerm21PseudoTerminalHelpersC">PseudoTerminalHelpers</a>
  434. </code>
  435. </div>
  436. <div class="height-container">
  437. <div class="pointer-container"></div>
  438. <section class="section">
  439. <div class="pointer"></div>
  440. <div class="abstract">
  441. <p>APIs to assist in controlling a Unix pseudo-terminal from Swift, it provides a wrapper for
  442. the libc <code>forkpty</code>API in the form of <code>fork(andExec:args:env:desiredWindowSize:</code> method,
  443. <code>setWinSize</code> and <code>availableBytes</code></p>
  444. <a href="Classes/PseudoTerminalHelpers.html" class="slightly-smaller">See more</a>
  445. </div>
  446. <div class="declaration">
  447. <h4>Declaration</h4>
  448. <div class="language">
  449. <p class="aside-title">Swift</p>
  450. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PseudoTerminalHelpers</span></code></pre>
  451. </div>
  452. </div>
  453. </section>
  454. </div>
  455. </li>
  456. <li class="item">
  457. <div>
  458. <code>
  459. <a name="/s:9SwiftTerm8TerminalC"></a>
  460. <a name="//apple_ref/swift/Class/Terminal" class="dashAnchor"></a>
  461. <a class="token" href="#/s:9SwiftTerm8TerminalC">Terminal</a>
  462. </code>
  463. </div>
  464. <div class="height-container">
  465. <div class="pointer-container"></div>
  466. <section class="section">
  467. <div class="pointer"></div>
  468. <div class="abstract">
  469. <p>The <code>Terminal</code> class provides the terminal emulation engine, and can be used to feed data to the
  470. terminal emulator. Typically users will intereact with a higher-level implementation that provides a
  471. UI toolkit-specific rendering and connects the input to the UI toolkit.</p>
  472. <p>A front-end would draw the contents of the terminal, and take input from the user, which is in turn
  473. either mapped to one of the public APIs here, or if it is user input is passed to the <code>feed</code> methods here.</p>
  474. <p>The terminal is also connected to a backend that is conneted to the client, and data from this
  475. client is fed into the emulator by calling the <code>sendResponse method</code></p>
  476. <p>The behavior of the terminal is configured by implementing the <code><a href="Protocols/TerminalDelegate.html">TerminalDelegate</a></code> protocol
  477. that is provided in the constructor call.</p>
  478. <a href="Classes/Terminal.html" class="slightly-smaller">See more</a>
  479. </div>
  480. <div class="declaration">
  481. <h4>Declaration</h4>
  482. <div class="language">
  483. <p class="aside-title">Swift</p>
  484. <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">Terminal</span></code></pre>
  485. </div>
  486. </div>
  487. </section>
  488. </div>
  489. </li>
  490. <li class="item">
  491. <div>
  492. <code>
  493. <a name="/"></a>
  494. <a name="//apple_ref/swift/Class/TerminalAccessory" class="dashAnchor"></a>
  495. <a class="token" href="#/">TerminalAccessory</a>
  496. </code>
  497. </div>
  498. <div class="height-container">
  499. <div class="pointer-container"></div>
  500. <section class="section">
  501. <div class="pointer"></div>
  502. <div class="abstract">
  503. <p>This class provides an input accessory for the terminal on iOS, you can access this via the <code>inputAccessoryView</code>
  504. property in the <code><a href="Classes/TerminalView.html">TerminalView</a></code> and casting the result to <code>TerminalAccessory</code>.</p>
  505. <p>This class surfaces some state that the terminal might want to poke at, you should at least support the following
  506. properties;
  507. <code>controlModifer</code> should be set if the control key is pressed</p>
  508. <a href="Classes/TerminalAccessory.html" class="slightly-smaller">See more</a>
  509. </div>
  510. </section>
  511. </div>
  512. </li>
  513. <li class="item">
  514. <div>
  515. <code>
  516. <a name="/"></a>
  517. <a name="//apple_ref/swift/Class/TerminalView" class="dashAnchor"></a>
  518. <a class="token" href="#/">TerminalView</a>
  519. </code>
  520. </div>
  521. <div class="height-container">
  522. <div class="pointer-container"></div>
  523. <section class="section">
  524. <div class="pointer"></div>
  525. <div class="abstract">
  526. <p>TerminalView provides an UIKit front-end to the <code><a href="Classes/Terminal.html">Terminal</a></code> termininal emulator.
  527. It is up to a subclass to either wire the terminal emulator to a remote terminal
  528. via some socket, to an application that wants to run with terminal emulation, or
  529. wiring this up to a pseudo-terminal.</p>
  530. <p>Users are notified of interesting events in their implementation of the <code><a href="Protocols/TerminalViewDelegate.html">TerminalViewDelegate</a></code>
  531. methods - an instance must be provided to the constructor of <code>TerminalView</code>.</p>
  532. <p>Call the <code>getTerminal</code> method to get a reference to the underlying <code><a href="Classes/Terminal.html">Terminal</a></code> that backs this
  533. view.</p>
  534. <p>Use the <code>configureNativeColors()</code> to set the defaults colors for the view to match the OS
  535. defaults, otherwise, this uses its own set of defaults colors.</p>
  536. <a href="Classes/TerminalView.html" class="slightly-smaller">See more</a>
  537. </div>
  538. <div class="declaration">
  539. <h4>Declaration</h4>
  540. <div class="language">
  541. <p class="aside-title">Swift</p>
  542. </div>
  543. </div>
  544. </section>
  545. </div>
  546. </li>
  547. </ul>
  548. </div>
  549. </section>
  550. </section>
  551. <section id="footer">
  552. <p>&copy; 2021 <a class="link" href="https://tirania.org/" target="_blank" rel="external">Miguel de Icaza</a>. All rights reserved. (Last updated: 2021-04-28)</p>
  553. <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
  554. </section>
  555. </article>
  556. </div>
  557. </body>
  558. </div>
  559. </html>