Terminal.html 100 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Terminal Class 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/Class/Terminal" class="dashAnchor"></a>
  16. <a title="Terminal Class 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. Terminal Class 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>Terminal</h1>
  171. <div class="declaration">
  172. <div class="language">
  173. <pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">Terminal</span></code></pre>
  174. </div>
  175. </div>
  176. <p>The <code>Terminal</code> class provides the terminal emulation engine, and can be used to feed data to the
  177. terminal emulator. Typically users will intereact with a higher-level implementation that provides a
  178. UI toolkit-specific rendering and connects the input to the UI toolkit.</p>
  179. <p>A front-end would draw the contents of the terminal, and take input from the user, which is in turn
  180. 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>
  181. <p>The terminal is also connected to a backend that is conneted to the client, and data from this
  182. client is fed into the emulator by calling the <code>sendResponse method</code></p>
  183. <p>The behavior of the terminal is configured by implementing the <code><a href="../Protocols/TerminalDelegate.html">TerminalDelegate</a></code> protocol
  184. that is provided in the constructor call.</p>
  185. </section>
  186. <section class="section task-group-section">
  187. <div class="task-group">
  188. <ul>
  189. <li class="item">
  190. <div>
  191. <code>
  192. <a name="/s:9SwiftTerm8TerminalC4colsSivp"></a>
  193. <a name="//apple_ref/swift/Property/cols" class="dashAnchor"></a>
  194. <a class="token" href="#/s:9SwiftTerm8TerminalC4colsSivp">cols</a>
  195. </code>
  196. </div>
  197. <div class="height-container">
  198. <div class="pointer-container"></div>
  199. <section class="section">
  200. <div class="pointer"></div>
  201. <div class="abstract">
  202. <p>The current terminal columns (counting from 1)</p>
  203. </div>
  204. <div class="declaration">
  205. <h4>Declaration</h4>
  206. <div class="language">
  207. <p class="aside-title">Swift</p>
  208. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="k">var</span> <span class="nv">cols</span><span class="p">:</span> <span class="kt">Int</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
  209. </div>
  210. </div>
  211. </section>
  212. </div>
  213. </li>
  214. <li class="item">
  215. <div>
  216. <code>
  217. <a name="/s:9SwiftTerm8TerminalC4rowsSivp"></a>
  218. <a name="//apple_ref/swift/Property/rows" class="dashAnchor"></a>
  219. <a class="token" href="#/s:9SwiftTerm8TerminalC4rowsSivp">rows</a>
  220. </code>
  221. </div>
  222. <div class="height-container">
  223. <div class="pointer-container"></div>
  224. <section class="section">
  225. <div class="pointer"></div>
  226. <div class="abstract">
  227. <p>The current terminal rows (counting from 1)</p>
  228. </div>
  229. <div class="declaration">
  230. <h4>Declaration</h4>
  231. <div class="language">
  232. <p class="aside-title">Swift</p>
  233. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="k">var</span> <span class="nv">rows</span><span class="p">:</span> <span class="kt">Int</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
  234. </div>
  235. </div>
  236. </section>
  237. </div>
  238. </li>
  239. <li class="item">
  240. <div>
  241. <code>
  242. <a name="/s:9SwiftTerm8TerminalC17applicationCursorSbvp"></a>
  243. <a name="//apple_ref/swift/Property/applicationCursor" class="dashAnchor"></a>
  244. <a class="token" href="#/s:9SwiftTerm8TerminalC17applicationCursorSbvp">applicationCursor</a>
  245. </code>
  246. </div>
  247. <div class="height-container">
  248. <div class="pointer-container"></div>
  249. <section class="section">
  250. <div class="pointer"></div>
  251. <div class="abstract">
  252. <p>Undocumented</p>
  253. </div>
  254. <div class="declaration">
  255. <h4>Declaration</h4>
  256. <div class="language">
  257. <p class="aside-title">Swift</p>
  258. <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">applicationCursor</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
  259. </div>
  260. </div>
  261. </section>
  262. </div>
  263. </li>
  264. <li class="item">
  265. <div>
  266. <code>
  267. <a name="/s:9SwiftTerm8TerminalC18bracketedPasteModeSbvp"></a>
  268. <a name="//apple_ref/swift/Property/bracketedPasteMode" class="dashAnchor"></a>
  269. <a class="token" href="#/s:9SwiftTerm8TerminalC18bracketedPasteModeSbvp">bracketedPasteMode</a>
  270. </code>
  271. </div>
  272. <div class="height-container">
  273. <div class="pointer-container"></div>
  274. <section class="section">
  275. <div class="pointer"></div>
  276. <div class="abstract">
  277. <p>Indicates that the application has toggled bracketed paste mode, which means that when content is pasted into
  278. the terminal, the content will be wrapped in &ldquo;ESC [ 200 ~&rdquo; to start, and &ldquo;ESC [ 201 ~&rdquo; to end.</p>
  279. </div>
  280. <div class="declaration">
  281. <h4>Declaration</h4>
  282. <div class="language">
  283. <p class="aside-title">Swift</p>
  284. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="k">var</span> <span class="nv">bracketedPasteMode</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
  285. </div>
  286. </div>
  287. </section>
  288. </div>
  289. </li>
  290. <li class="item">
  291. <div>
  292. <code>
  293. <a name="/s:9SwiftTerm8TerminalC20hostCurrentDirectorySSSgvp"></a>
  294. <a name="//apple_ref/swift/Property/hostCurrentDirectory" class="dashAnchor"></a>
  295. <a class="token" href="#/s:9SwiftTerm8TerminalC20hostCurrentDirectorySSSgvp">hostCurrentDirectory</a>
  296. </code>
  297. </div>
  298. <div class="height-container">
  299. <div class="pointer-container"></div>
  300. <section class="section">
  301. <div class="pointer"></div>
  302. <div class="abstract">
  303. <p>This variable if set, contains an URI representing the host and directory of the process running in the terminal
  304. it is often used by applciations to track the working directory. It might be nil, or might not be correct, the
  305. contents are entirely under the control of the remote application, and require the terminal to be trusted
  306. (see the <code>isProcessTrusted</code> method in the <code><a href="../Protocols/TerminalDelegate.html">TerminalDelegate</a></code>). When this is set the
  307. <code>hostCurrentDirectoryUpdated</code> method on the delegate is invoked.</p>
  308. </div>
  309. <div class="declaration">
  310. <h4>Declaration</h4>
  311. <div class="language">
  312. <p class="aside-title">Swift</p>
  313. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="k">var</span> <span class="nv">hostCurrentDirectory</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
  314. </div>
  315. </div>
  316. </section>
  317. </div>
  318. </li>
  319. <li class="item">
  320. <div>
  321. <code>
  322. <a name="/s:9SwiftTerm8TerminalC19hostCurrentDocumentSSSgvp"></a>
  323. <a name="//apple_ref/swift/Property/hostCurrentDocument" class="dashAnchor"></a>
  324. <a class="token" href="#/s:9SwiftTerm8TerminalC19hostCurrentDocumentSSSgvp">hostCurrentDocument</a>
  325. </code>
  326. </div>
  327. <div class="height-container">
  328. <div class="pointer-container"></div>
  329. <section class="section">
  330. <div class="pointer"></div>
  331. <div class="abstract">
  332. <p>This variable if set, contains an URI representing the host and current document of the process
  333. running in the terminal. It might be nil, or might not be correct, the
  334. contents are entirely under the control of the remote application, and require the terminal to be trusted
  335. (see the <code>isProcessTrusted</code> method in the <code><a href="../Protocols/TerminalDelegate.html">TerminalDelegate</a></code>). When this is set the
  336. <code>hostCurrentDocumentUpdated</code> method on the delegate is invoked.</p>
  337. </div>
  338. <div class="declaration">
  339. <h4>Declaration</h4>
  340. <div class="language">
  341. <p class="aside-title">Swift</p>
  342. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="k">var</span> <span class="nv">hostCurrentDocument</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
  343. </div>
  344. </div>
  345. </section>
  346. </div>
  347. </li>
  348. <li class="item">
  349. <div>
  350. <code>
  351. <a name="/s:9SwiftTerm8TerminalC16currentAttributeAA0E0Vvp"></a>
  352. <a name="//apple_ref/swift/Property/currentAttribute" class="dashAnchor"></a>
  353. <a class="token" href="#/s:9SwiftTerm8TerminalC16currentAttributeAA0E0Vvp">currentAttribute</a>
  354. </code>
  355. </div>
  356. <div class="height-container">
  357. <div class="pointer-container"></div>
  358. <section class="section">
  359. <div class="pointer"></div>
  360. <div class="abstract">
  361. <p>The current attribute used by the terminal by default</p>
  362. </div>
  363. <div class="declaration">
  364. <h4>Declaration</h4>
  365. <div class="language">
  366. <p class="aside-title">Swift</p>
  367. <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">currentAttribute</span><span class="p">:</span> <span class="kt"><a href="../Structs/Attribute.html">Attribute</a></span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
  368. </div>
  369. </div>
  370. </section>
  371. </div>
  372. </li>
  373. <li class="item">
  374. <div>
  375. <code>
  376. <a name="/s:9SwiftTerm8TerminalC15foregroundColorAA0E0Cvp"></a>
  377. <a name="//apple_ref/swift/Property/foregroundColor" class="dashAnchor"></a>
  378. <a class="token" href="#/s:9SwiftTerm8TerminalC15foregroundColorAA0E0Cvp">foregroundColor</a>
  379. </code>
  380. </div>
  381. <div class="height-container">
  382. <div class="pointer-container"></div>
  383. <section class="section">
  384. <div class="pointer"></div>
  385. <div class="abstract">
  386. <p>This tracks the current foreground color for the application.</p>
  387. </div>
  388. <div class="declaration">
  389. <h4>Declaration</h4>
  390. <div class="language">
  391. <p class="aside-title">Swift</p>
  392. <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">foregroundColor</span><span class="p">:</span> <span class="kt"><a href="../Classes/Color.html">Color</a></span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
  393. </div>
  394. </div>
  395. </section>
  396. </div>
  397. </li>
  398. <li class="item">
  399. <div>
  400. <code>
  401. <a name="/s:9SwiftTerm8TerminalC15backgroundColorAA0E0Cvp"></a>
  402. <a name="//apple_ref/swift/Property/backgroundColor" class="dashAnchor"></a>
  403. <a class="token" href="#/s:9SwiftTerm8TerminalC15backgroundColorAA0E0Cvp">backgroundColor</a>
  404. </code>
  405. </div>
  406. <div class="height-container">
  407. <div class="pointer-container"></div>
  408. <section class="section">
  409. <div class="pointer"></div>
  410. <div class="abstract">
  411. <p>This tracks the current background color for the application.</p>
  412. </div>
  413. <div class="declaration">
  414. <h4>Declaration</h4>
  415. <div class="language">
  416. <p class="aside-title">Swift</p>
  417. <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">backgroundColor</span><span class="p">:</span> <span class="kt"><a href="../Classes/Color.html">Color</a></span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
  418. </div>
  419. </div>
  420. </section>
  421. </div>
  422. </li>
  423. <li class="item">
  424. <div>
  425. <code>
  426. <a name="/s:9SwiftTerm8TerminalC9MouseModeO"></a>
  427. <a name="//apple_ref/swift/Enum/MouseMode" class="dashAnchor"></a>
  428. <a class="token" href="#/s:9SwiftTerm8TerminalC9MouseModeO">MouseMode</a>
  429. </code>
  430. </div>
  431. <div class="height-container">
  432. <div class="pointer-container"></div>
  433. <section class="section">
  434. <div class="pointer"></div>
  435. <div class="abstract">
  436. <p>Represents the mouse operation mode that the terminal is currently using and higher level
  437. implementations should use the functions in this enumeration to determine what events to
  438. send</p>
  439. <a href="../Classes/Terminal/MouseMode.html" class="slightly-smaller">See more</a>
  440. </div>
  441. <div class="declaration">
  442. <h4>Declaration</h4>
  443. <div class="language">
  444. <p class="aside-title">Swift</p>
  445. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">MouseMode</span></code></pre>
  446. </div>
  447. </div>
  448. </section>
  449. </div>
  450. </li>
  451. <li class="item">
  452. <div>
  453. <code>
  454. <a name="/s:9SwiftTerm8TerminalC9mouseModeAC05MouseE0Ovp"></a>
  455. <a name="//apple_ref/swift/Property/mouseMode" class="dashAnchor"></a>
  456. <a class="token" href="#/s:9SwiftTerm8TerminalC9mouseModeAC05MouseE0Ovp">mouseMode</a>
  457. </code>
  458. </div>
  459. <div class="height-container">
  460. <div class="pointer-container"></div>
  461. <section class="section">
  462. <div class="pointer"></div>
  463. <div class="abstract">
  464. <p>Undocumented</p>
  465. </div>
  466. <div class="declaration">
  467. <h4>Declaration</h4>
  468. <div class="language">
  469. <p class="aside-title">Swift</p>
  470. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="k">var</span> <span class="nv">mouseMode</span><span class="p">:</span> <span class="kt"><a href="../Classes/Terminal/MouseMode.html">MouseMode</a></span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
  471. </div>
  472. </div>
  473. </section>
  474. </div>
  475. </li>
  476. <li class="item">
  477. <div>
  478. <code>
  479. <a name="/s:9SwiftTerm8TerminalC7getDimsSi4cols_Si4rowstyF"></a>
  480. <a name="//apple_ref/swift/Method/getDims()" class="dashAnchor"></a>
  481. <a class="token" href="#/s:9SwiftTerm8TerminalC7getDimsSi4cols_Si4rowstyF">getDims()</a>
  482. </code>
  483. </div>
  484. <div class="height-container">
  485. <div class="pointer-container"></div>
  486. <section class="section">
  487. <div class="pointer"></div>
  488. <div class="abstract">
  489. <p>Returns the terminal dimensions 1-based values</p>
  490. </div>
  491. <div class="declaration">
  492. <h4>Declaration</h4>
  493. <div class="language">
  494. <p class="aside-title">Swift</p>
  495. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getDims</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="nv">cols</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">rows</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
  496. </div>
  497. </div>
  498. </section>
  499. </div>
  500. </li>
  501. <li class="item">
  502. <div>
  503. <code>
  504. <a name="/s:9SwiftTerm8TerminalC8delegate7optionsAcA0C8Delegate_p_AA0C7OptionsVtcfc"></a>
  505. <a name="//apple_ref/swift/Method/init(delegate:options:)" class="dashAnchor"></a>
  506. <a class="token" href="#/s:9SwiftTerm8TerminalC8delegate7optionsAcA0C8Delegate_p_AA0C7OptionsVtcfc">init(delegate:<wbr>options:<wbr>)</a>
  507. </code>
  508. </div>
  509. <div class="height-container">
  510. <div class="pointer-container"></div>
  511. <section class="section">
  512. <div class="pointer"></div>
  513. <div class="abstract">
  514. <p>Undocumented</p>
  515. </div>
  516. <div class="declaration">
  517. <h4>Declaration</h4>
  518. <div class="language">
  519. <p class="aside-title">Swift</p>
  520. <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">delegate</span><span class="p">:</span> <span class="kt"><a href="../Protocols/TerminalDelegate.html">TerminalDelegate</a></span><span class="p">,</span> <span class="nv">options</span><span class="p">:</span> <span class="kt"><a href="../Structs/TerminalOptions.html">TerminalOptions</a></span> <span class="o">=</span> <span class="kt"><a href="../Structs/TerminalOptions.html">TerminalOptions</a></span><span class="o">.</span><span class="k">default</span><span class="p">)</span></code></pre>
  521. </div>
  522. </div>
  523. </section>
  524. </div>
  525. </li>
  526. <li class="item">
  527. <div>
  528. <code>
  529. <a name="/s:9SwiftTerm8TerminalC14installPalette6colorsySayAA5ColorCG_tF"></a>
  530. <a name="//apple_ref/swift/Method/installPalette(colors:)" class="dashAnchor"></a>
  531. <a class="token" href="#/s:9SwiftTerm8TerminalC14installPalette6colorsySayAA5ColorCG_tF">installPalette(colors:<wbr>)</a>
  532. </code>
  533. </div>
  534. <div class="height-container">
  535. <div class="pointer-container"></div>
  536. <section class="section">
  537. <div class="pointer"></div>
  538. <div class="abstract">
  539. <p>Installs the new colors as the default colors and recomputes the
  540. current and ansi palette. This will not change the UI layer, for that it is better
  541. to call the <code>installColors</code> method on <code><a href="../Classes/TerminalView.html">TerminalView</a></code>, which will
  542. both call this method, and update the display appropriately.</p>
  543. </div>
  544. <div class="declaration">
  545. <h4>Declaration</h4>
  546. <div class="language">
  547. <p class="aside-title">Swift</p>
  548. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">installPalette</span><span class="p">(</span><span class="nv">colors</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Classes/Color.html">Color</a></span><span class="p">])</span></code></pre>
  549. </div>
  550. </div>
  551. <div>
  552. <h4>Parameters</h4>
  553. <table class="graybox">
  554. <tbody>
  555. <tr>
  556. <td>
  557. <code>
  558. <em>colors</em>
  559. </code>
  560. </td>
  561. <td>
  562. <div>
  563. <p>this should be an array of 16 values that correspond to the 16 ANSI colors,
  564. if the array does not contain 16 elements, it will not do anything</p>
  565. </div>
  566. </td>
  567. </tr>
  568. </tbody>
  569. </table>
  570. </div>
  571. </section>
  572. </div>
  573. </li>
  574. <li class="item">
  575. <div>
  576. <code>
  577. <a name="/s:9SwiftTerm8TerminalC11getCharData3col3rowAA0eF0VSgSi_SitF"></a>
  578. <a name="//apple_ref/swift/Method/getCharData(col:row:)" class="dashAnchor"></a>
  579. <a class="token" href="#/s:9SwiftTerm8TerminalC11getCharData3col3rowAA0eF0VSgSi_SitF">getCharData(col:<wbr>row:<wbr>)</a>
  580. </code>
  581. </div>
  582. <div class="height-container">
  583. <div class="pointer-container"></div>
  584. <section class="section">
  585. <div class="pointer"></div>
  586. <div class="abstract">
  587. <p>Returns the CharData at the specified column and row from the visible portion of the buffer, these are zero-based</p>
  588. </div>
  589. <div class="declaration">
  590. <h4>Declaration</h4>
  591. <div class="language">
  592. <p class="aside-title">Swift</p>
  593. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getCharData</span><span class="p">(</span><span class="nv">col</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">row</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Structs/CharData.html">CharData</a></span><span class="p">?</span></code></pre>
  594. </div>
  595. </div>
  596. <div>
  597. <h4>Parameters</h4>
  598. <table class="graybox">
  599. <tbody>
  600. <tr>
  601. <td>
  602. <code>
  603. <em>col</em>
  604. </code>
  605. </td>
  606. <td>
  607. <div>
  608. <p>column to retrieve, starts at 0</p>
  609. </div>
  610. </td>
  611. </tr>
  612. <tr>
  613. <td>
  614. <code>
  615. <em>row</em>
  616. </code>
  617. </td>
  618. <td>
  619. <div>
  620. <p>row to retrieve, starts at 0</p>
  621. </div>
  622. </td>
  623. </tr>
  624. </tbody>
  625. </table>
  626. </div>
  627. <div>
  628. <h4>Return Value</h4>
  629. <p>nil if the col or row are out of bounds, or the CharData contained in that cell otherwise</p>
  630. </div>
  631. </section>
  632. </div>
  633. </li>
  634. <li class="item">
  635. <div>
  636. <code>
  637. <a name="/s:9SwiftTerm8TerminalC7getLine3rowAA06BufferE0CSgSi_tF"></a>
  638. <a name="//apple_ref/swift/Method/getLine(row:)" class="dashAnchor"></a>
  639. <a class="token" href="#/s:9SwiftTerm8TerminalC7getLine3rowAA06BufferE0CSgSi_tF">getLine(row:<wbr>)</a>
  640. </code>
  641. </div>
  642. <div class="height-container">
  643. <div class="pointer-container"></div>
  644. <section class="section">
  645. <div class="pointer"></div>
  646. <div class="abstract">
  647. <p>Returns the contents of a line as a BufferLine, or nil if the requested line is out of range</p>
  648. <p>The line is counted from start of scroll back, not what the terminal has visible right now.</p>
  649. </div>
  650. <div class="declaration">
  651. <h4>Declaration</h4>
  652. <div class="language">
  653. <p class="aside-title">Swift</p>
  654. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getLine</span><span class="p">(</span><span class="nv">row</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Classes/BufferLine.html">BufferLine</a></span><span class="p">?</span></code></pre>
  655. </div>
  656. </div>
  657. <div>
  658. <h4>Parameters</h4>
  659. <table class="graybox">
  660. <tbody>
  661. <tr>
  662. <td>
  663. <code>
  664. <em>row</em>
  665. </code>
  666. </td>
  667. <td>
  668. <div>
  669. <p>the row to retrieve, relative to the scroll buffer, not the visible display</p>
  670. </div>
  671. </td>
  672. </tr>
  673. </tbody>
  674. </table>
  675. </div>
  676. <div>
  677. <h4>Return Value</h4>
  678. <p>nil if the col or row are out of bounds, or the BufferLine otherwise</p>
  679. </div>
  680. </section>
  681. </div>
  682. </li>
  683. <li class="item">
  684. <div>
  685. <code>
  686. <a name="/s:9SwiftTerm8TerminalC22getScrollInvariantLine3rowAA06BufferG0CSgSi_tF"></a>
  687. <a name="//apple_ref/swift/Method/getScrollInvariantLine(row:)" class="dashAnchor"></a>
  688. <a class="token" href="#/s:9SwiftTerm8TerminalC22getScrollInvariantLine3rowAA06BufferG0CSgSi_tF">getScrollInvariantLine(row:<wbr>)</a>
  689. </code>
  690. </div>
  691. <div class="height-container">
  692. <div class="pointer-container"></div>
  693. <section class="section">
  694. <div class="pointer"></div>
  695. <div class="abstract">
  696. <p>Returns the contents of a line as a BufferLine counting from the begging of the scroll buffer.</p>
  697. <p>The line is counted from start of scroll back, not what the terminal has visible right now.</p>
  698. </div>
  699. <div class="declaration">
  700. <h4>Declaration</h4>
  701. <div class="language">
  702. <p class="aside-title">Swift</p>
  703. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getScrollInvariantLine</span><span class="p">(</span><span class="nv">row</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Classes/BufferLine.html">BufferLine</a></span><span class="p">?</span></code></pre>
  704. </div>
  705. </div>
  706. <div>
  707. <h4>Parameters</h4>
  708. <table class="graybox">
  709. <tbody>
  710. <tr>
  711. <td>
  712. <code>
  713. <em>row</em>
  714. </code>
  715. </td>
  716. <td>
  717. <div>
  718. <p>the row to retrieve, relative to the scroll buffer, not the visible display</p>
  719. </div>
  720. </td>
  721. </tr>
  722. </tbody>
  723. </table>
  724. </div>
  725. <div>
  726. <h4>Return Value</h4>
  727. <p>nil if the col or row are out of bounds, or the BufferLine otherwise</p>
  728. </div>
  729. </section>
  730. </div>
  731. </li>
  732. <li class="item">
  733. <div>
  734. <code>
  735. <a name="/s:9SwiftTerm8TerminalC12getCharacter3col3rowSJSgSi_SitF"></a>
  736. <a name="//apple_ref/swift/Method/getCharacter(col:row:)" class="dashAnchor"></a>
  737. <a class="token" href="#/s:9SwiftTerm8TerminalC12getCharacter3col3rowSJSgSi_SitF">getCharacter(col:<wbr>row:<wbr>)</a>
  738. </code>
  739. </div>
  740. <div class="height-container">
  741. <div class="pointer-container"></div>
  742. <section class="section">
  743. <div class="pointer"></div>
  744. <div class="abstract">
  745. <p>Returns the character at the specified column and row, these are zero-based</p>
  746. </div>
  747. <div class="declaration">
  748. <h4>Declaration</h4>
  749. <div class="language">
  750. <p class="aside-title">Swift</p>
  751. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getCharacter</span><span class="p">(</span><span class="nv">col</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">row</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Character</span><span class="p">?</span></code></pre>
  752. </div>
  753. </div>
  754. <div>
  755. <h4>Parameters</h4>
  756. <table class="graybox">
  757. <tbody>
  758. <tr>
  759. <td>
  760. <code>
  761. <em>col</em>
  762. </code>
  763. </td>
  764. <td>
  765. <div>
  766. <p>column to retrieve, starts at 0</p>
  767. </div>
  768. </td>
  769. </tr>
  770. <tr>
  771. <td>
  772. <code>
  773. <em>row</em>
  774. </code>
  775. </td>
  776. <td>
  777. <div>
  778. <p>row to retrieve, starts at 0</p>
  779. </div>
  780. </td>
  781. </tr>
  782. </tbody>
  783. </table>
  784. </div>
  785. <div>
  786. <h4>Return Value</h4>
  787. <p>nil if the col or row are out of bounds, or the Character contained in that cell otherwise</p>
  788. </div>
  789. </section>
  790. </div>
  791. </li>
  792. <li class="item">
  793. <div>
  794. <code>
  795. <a name="/s:9SwiftTerm8TerminalC25WindowManipulationCommandO"></a>
  796. <a name="//apple_ref/swift/Enum/WindowManipulationCommand" class="dashAnchor"></a>
  797. <a class="token" href="#/s:9SwiftTerm8TerminalC25WindowManipulationCommandO">WindowManipulationCommand</a>
  798. </code>
  799. </div>
  800. <div class="height-container">
  801. <div class="pointer-container"></div>
  802. <section class="section">
  803. <div class="pointer"></div>
  804. <div class="abstract">
  805. <p>Commands send to the <code>windowCommand</code> delegate for the front-end to implement capabilities
  806. on behalf of the client. The expected return strings in some of these enumeration values is documented
  807. below. Returns are only expected for the enum values that start with the prefix <code>report</code></p>
  808. <a href="../Classes/Terminal/WindowManipulationCommand.html" class="slightly-smaller">See more</a>
  809. </div>
  810. <div class="declaration">
  811. <h4>Declaration</h4>
  812. <div class="language">
  813. <p class="aside-title">Swift</p>
  814. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">WindowManipulationCommand</span></code></pre>
  815. </div>
  816. </div>
  817. </section>
  818. </div>
  819. </li>
  820. <li class="item">
  821. <div>
  822. <code>
  823. <a name="/s:9SwiftTerm8TerminalC9softResetyyF"></a>
  824. <a name="//apple_ref/swift/Method/softReset()" class="dashAnchor"></a>
  825. <a class="token" href="#/s:9SwiftTerm8TerminalC9softResetyyF">softReset()</a>
  826. </code>
  827. </div>
  828. <div class="height-container">
  829. <div class="pointer-container"></div>
  830. <section class="section">
  831. <div class="pointer"></div>
  832. <div class="abstract">
  833. <p>Performs a terminal soft-reset, the equivalent of the DECSTR sequence
  834. For a full reset see <code>resetToInitialState</code></p>
  835. </div>
  836. <div class="declaration">
  837. <h4>Declaration</h4>
  838. <div class="language">
  839. <p class="aside-title">Swift</p>
  840. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">softReset</span><span class="p">()</span></code></pre>
  841. </div>
  842. </div>
  843. </section>
  844. </div>
  845. </li>
  846. <li class="item">
  847. <div>
  848. <code>
  849. <a name="/s:9SwiftTerm8TerminalC12sendResponse4textySS_tF"></a>
  850. <a name="//apple_ref/swift/Method/sendResponse(text:)" class="dashAnchor"></a>
  851. <a class="token" href="#/s:9SwiftTerm8TerminalC12sendResponse4textySS_tF">sendResponse(text:<wbr>)</a>
  852. </code>
  853. </div>
  854. <div class="height-container">
  855. <div class="pointer-container"></div>
  856. <section class="section">
  857. <div class="pointer"></div>
  858. <div class="abstract">
  859. <p>Sends the provided text to the connected backend</p>
  860. </div>
  861. <div class="declaration">
  862. <h4>Declaration</h4>
  863. <div class="language">
  864. <p class="aside-title">Swift</p>
  865. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">sendResponse</span><span class="p">(</span><span class="nv">text</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
  866. </div>
  867. </div>
  868. </section>
  869. </div>
  870. </li>
  871. <li class="item">
  872. <div>
  873. <code>
  874. <a name="/s:9SwiftTerm8TerminalC12sendResponseyyypd_tF"></a>
  875. <a name="//apple_ref/swift/Method/sendResponse(_:)" class="dashAnchor"></a>
  876. <a class="token" href="#/s:9SwiftTerm8TerminalC12sendResponseyyypd_tF">sendResponse(_:<wbr>)</a>
  877. </code>
  878. </div>
  879. <div class="height-container">
  880. <div class="pointer-container"></div>
  881. <section class="section">
  882. <div class="pointer"></div>
  883. <div class="abstract">
  884. <p>Sends the provided text to the connected backend, takes a variable list of arguments
  885. that could be either [UInt8], Strings, or a single UInt8 value.</p>
  886. </div>
  887. <div class="declaration">
  888. <h4>Declaration</h4>
  889. <div class="language">
  890. <p class="aside-title">Swift</p>
  891. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">sendResponse</span><span class="p">(</span><span class="n">_</span> <span class="nv">items</span><span class="p">:</span> <span class="kt">Any</span><span class="o">...</span><span class="p">)</span></code></pre>
  892. </div>
  893. </div>
  894. </section>
  895. </div>
  896. </li>
  897. <li class="item">
  898. <div>
  899. <code>
  900. <a name="/s:9SwiftTerm8TerminalC9silentLogSbvp"></a>
  901. <a name="//apple_ref/swift/Property/silentLog" class="dashAnchor"></a>
  902. <a class="token" href="#/s:9SwiftTerm8TerminalC9silentLogSbvp">silentLog</a>
  903. </code>
  904. </div>
  905. <div class="height-container">
  906. <div class="pointer-container"></div>
  907. <section class="section">
  908. <div class="pointer"></div>
  909. <div class="abstract">
  910. <p>Undocumented</p>
  911. </div>
  912. <div class="declaration">
  913. <h4>Declaration</h4>
  914. <div class="language">
  915. <p class="aside-title">Swift</p>
  916. <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">silentLog</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
  917. </div>
  918. </div>
  919. </section>
  920. </div>
  921. </li>
  922. <li class="item">
  923. <div>
  924. <code>
  925. <a name="/"></a>
  926. <a name="//apple_ref/swift/Property/silentLog" class="dashAnchor"></a>
  927. <a class="token" href="#/">silentLog</a>
  928. </code>
  929. </div>
  930. <div class="height-container">
  931. <div class="pointer-container"></div>
  932. <section class="section">
  933. <div class="pointer"></div>
  934. <div class="abstract">
  935. </div>
  936. </section>
  937. </div>
  938. </li>
  939. <li class="item">
  940. <div>
  941. <code>
  942. <a name="/s:9SwiftTerm8TerminalC4feed9byteArrayySays5UInt8VG_tF"></a>
  943. <a name="//apple_ref/swift/Method/feed(byteArray:)" class="dashAnchor"></a>
  944. <a class="token" href="#/s:9SwiftTerm8TerminalC4feed9byteArrayySays5UInt8VG_tF">feed(byteArray:<wbr>)</a>
  945. </code>
  946. </div>
  947. <div class="height-container">
  948. <div class="pointer-container"></div>
  949. <section class="section">
  950. <div class="pointer"></div>
  951. <div class="abstract">
  952. <p>Processes the provided byte-array coming from the backend</p>
  953. </div>
  954. <div class="declaration">
  955. <h4>Declaration</h4>
  956. <div class="language">
  957. <p class="aside-title">Swift</p>
  958. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">feed</span><span class="p">(</span><span class="nv">byteArray</span><span class="p">:</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">])</span></code></pre>
  959. </div>
  960. </div>
  961. </section>
  962. </div>
  963. </li>
  964. <li class="item">
  965. <div>
  966. <code>
  967. <a name="/s:9SwiftTerm8TerminalC4feed4textySS_tF"></a>
  968. <a name="//apple_ref/swift/Method/feed(text:)" class="dashAnchor"></a>
  969. <a class="token" href="#/s:9SwiftTerm8TerminalC4feed4textySS_tF">feed(text:<wbr>)</a>
  970. </code>
  971. </div>
  972. <div class="height-container">
  973. <div class="pointer-container"></div>
  974. <section class="section">
  975. <div class="pointer"></div>
  976. <div class="abstract">
  977. <p>Undocumented</p>
  978. </div>
  979. <div class="declaration">
  980. <h4>Declaration</h4>
  981. <div class="language">
  982. <p class="aside-title">Swift</p>
  983. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">feed</span><span class="p">(</span><span class="nv">text</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
  984. </div>
  985. </div>
  986. </section>
  987. </div>
  988. </li>
  989. <li class="item">
  990. <div>
  991. <code>
  992. <a name="/s:9SwiftTerm8TerminalC4feed6bufferys10ArraySliceVys5UInt8VG_tF"></a>
  993. <a name="//apple_ref/swift/Method/feed(buffer:)" class="dashAnchor"></a>
  994. <a class="token" href="#/s:9SwiftTerm8TerminalC4feed6bufferys10ArraySliceVys5UInt8VG_tF">feed(buffer:<wbr>)</a>
  995. </code>
  996. </div>
  997. <div class="height-container">
  998. <div class="pointer-container"></div>
  999. <section class="section">
  1000. <div class="pointer"></div>
  1001. <div class="abstract">
  1002. <p>Undocumented</p>
  1003. </div>
  1004. <div class="declaration">
  1005. <h4>Declaration</h4>
  1006. <div class="language">
  1007. <p class="aside-title">Swift</p>
  1008. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">feed</span><span class="p">(</span><span class="nv">buffer</span><span class="p">:</span> <span class="kt">ArraySlice</span><span class="o">&lt;</span><span class="kt">UInt8</span><span class="o">&gt;</span><span class="p">)</span></code></pre>
  1009. </div>
  1010. </div>
  1011. </section>
  1012. </div>
  1013. </li>
  1014. <li class="item">
  1015. <div>
  1016. <code>
  1017. <a name="/s:9SwiftTerm8TerminalC5parse6bufferys10ArraySliceVys5UInt8VG_tF"></a>
  1018. <a name="//apple_ref/swift/Method/parse(buffer:)" class="dashAnchor"></a>
  1019. <a class="token" href="#/s:9SwiftTerm8TerminalC5parse6bufferys10ArraySliceVys5UInt8VG_tF">parse(buffer:<wbr>)</a>
  1020. </code>
  1021. </div>
  1022. <div class="height-container">
  1023. <div class="pointer-container"></div>
  1024. <section class="section">
  1025. <div class="pointer"></div>
  1026. <div class="abstract">
  1027. <p>Undocumented</p>
  1028. </div>
  1029. <div class="declaration">
  1030. <h4>Declaration</h4>
  1031. <div class="language">
  1032. <p class="aside-title">Swift</p>
  1033. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">parse</span><span class="p">(</span><span class="nv">buffer</span><span class="p">:</span> <span class="kt">ArraySlice</span><span class="o">&lt;</span><span class="kt">UInt8</span><span class="o">&gt;</span><span class="p">)</span></code></pre>
  1034. </div>
  1035. </div>
  1036. </section>
  1037. </div>
  1038. </li>
  1039. <li class="item">
  1040. <div>
  1041. <code>
  1042. <a name="/s:9SwiftTerm8TerminalC16updateFullScreenyyF"></a>
  1043. <a name="//apple_ref/swift/Method/updateFullScreen()" class="dashAnchor"></a>
  1044. <a class="token" href="#/s:9SwiftTerm8TerminalC16updateFullScreenyyF">updateFullScreen()</a>
  1045. </code>
  1046. </div>
  1047. <div class="height-container">
  1048. <div class="pointer-container"></div>
  1049. <section class="section">
  1050. <div class="pointer"></div>
  1051. <div class="abstract">
  1052. <p>Undocumented</p>
  1053. </div>
  1054. <div class="declaration">
  1055. <h4>Declaration</h4>
  1056. <div class="language">
  1057. <p class="aside-title">Swift</p>
  1058. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">updateFullScreen</span><span class="p">()</span></code></pre>
  1059. </div>
  1060. </div>
  1061. </section>
  1062. </div>
  1063. </li>
  1064. <li class="item">
  1065. <div>
  1066. <code>
  1067. <a name="/s:9SwiftTerm8TerminalC14getUpdateRangeSi6startY_Si4endYtSgyF"></a>
  1068. <a name="//apple_ref/swift/Method/getUpdateRange()" class="dashAnchor"></a>
  1069. <a class="token" href="#/s:9SwiftTerm8TerminalC14getUpdateRangeSi6startY_Si4endYtSgyF">getUpdateRange()</a>
  1070. </code>
  1071. </div>
  1072. <div class="height-container">
  1073. <div class="pointer-container"></div>
  1074. <section class="section">
  1075. <div class="pointer"></div>
  1076. <div class="abstract">
  1077. <p>Returns the starting and ending lines that need to be redrawn, or nil
  1078. if no part of the screen needs to be updated. Alternatively, you can
  1079. get a Set<Int> with the changed lines by calling <code><a href="../Classes/Terminal.html#/s:9SwiftTerm8TerminalC12changedLinesShySiGyF">changedLines()</a></code>.</p>
  1080. <p>UI toolkits should call <code>clearUpdateRange</code> to reset these changes
  1081. after they have used this information, so that new changes only reflect
  1082. the actual changes.</p>
  1083. </div>
  1084. <div class="declaration">
  1085. <h4>Declaration</h4>
  1086. <div class="language">
  1087. <p class="aside-title">Swift</p>
  1088. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getUpdateRange</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="nv">startY</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">endY</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)?</span></code></pre>
  1089. </div>
  1090. </div>
  1091. </section>
  1092. </div>
  1093. </li>
  1094. <li class="item">
  1095. <div>
  1096. <code>
  1097. <a name="/s:9SwiftTerm8TerminalC12changedLinesShySiGyF"></a>
  1098. <a name="//apple_ref/swift/Method/changedLines()" class="dashAnchor"></a>
  1099. <a class="token" href="#/s:9SwiftTerm8TerminalC12changedLinesShySiGyF">changedLines()</a>
  1100. </code>
  1101. </div>
  1102. <div class="height-container">
  1103. <div class="pointer-container"></div>
  1104. <section class="section">
  1105. <div class="pointer"></div>
  1106. <div class="abstract">
  1107. <p>Returns a set containing the lines that have been modified, the
  1108. returned set is not sorted.</p>
  1109. <p>UI toolkits should call <code>clearUpdateRange</code> to reset these changes
  1110. after they have used this information, so that new changes only reflect
  1111. the actual changes.</p>
  1112. </div>
  1113. <div class="declaration">
  1114. <h4>Declaration</h4>
  1115. <div class="language">
  1116. <p class="aside-title">Swift</p>
  1117. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">changedLines</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Set</span><span class="o">&lt;</span><span class="kt">Int</span><span class="o">&gt;</span></code></pre>
  1118. </div>
  1119. </div>
  1120. </section>
  1121. </div>
  1122. </li>
  1123. <li class="item">
  1124. <div>
  1125. <code>
  1126. <a name="/s:9SwiftTerm8TerminalC21garbageCollectPayloadyyF"></a>
  1127. <a name="//apple_ref/swift/Method/garbageCollectPayload()" class="dashAnchor"></a>
  1128. <a class="token" href="#/s:9SwiftTerm8TerminalC21garbageCollectPayloadyyF">garbageCollectPayload()</a>
  1129. </code>
  1130. </div>
  1131. <div class="height-container">
  1132. <div class="pointer-container"></div>
  1133. <section class="section">
  1134. <div class="pointer"></div>
  1135. <div class="abstract">
  1136. <p>Check for payload identifiers that are not in use and stop retaining their payload,
  1137. to avoid accumulting memory for images and URLs that are no longer visible or
  1138. available by scrolling.</p>
  1139. </div>
  1140. <div class="declaration">
  1141. <h4>Declaration</h4>
  1142. <div class="language">
  1143. <p class="aside-title">Swift</p>
  1144. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">garbageCollectPayload</span><span class="p">()</span></code></pre>
  1145. </div>
  1146. </div>
  1147. </section>
  1148. </div>
  1149. </li>
  1150. <li class="item">
  1151. <div>
  1152. <code>
  1153. <a name="/s:9SwiftTerm8TerminalC29getScrollInvariantUpdateRangeSi6startY_Si4endYtSgyF"></a>
  1154. <a name="//apple_ref/swift/Method/getScrollInvariantUpdateRange()" class="dashAnchor"></a>
  1155. <a class="token" href="#/s:9SwiftTerm8TerminalC29getScrollInvariantUpdateRangeSi6startY_Si4endYtSgyF">getScrollInvariantUpdateRange()</a>
  1156. </code>
  1157. </div>
  1158. <div class="height-container">
  1159. <div class="pointer-container"></div>
  1160. <section class="section">
  1161. <div class="pointer"></div>
  1162. <div class="abstract">
  1163. <p>Returns the starting and ending lines that need to be redrawn, or nil
  1164. if no part of the screen needs to be updated.</p>
  1165. <p>This is different from getUpdateRange() in that lines are from start of scroll back,
  1166. not what the terminal has visible right now.</p>
  1167. </div>
  1168. <div class="declaration">
  1169. <h4>Declaration</h4>
  1170. <div class="language">
  1171. <p class="aside-title">Swift</p>
  1172. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getScrollInvariantUpdateRange</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="nv">startY</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">endY</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)?</span></code></pre>
  1173. </div>
  1174. </div>
  1175. </section>
  1176. </div>
  1177. </li>
  1178. <li class="item">
  1179. <div>
  1180. <code>
  1181. <a name="/s:9SwiftTerm8TerminalC16clearUpdateRangeyyF"></a>
  1182. <a name="//apple_ref/swift/Method/clearUpdateRange()" class="dashAnchor"></a>
  1183. <a class="token" href="#/s:9SwiftTerm8TerminalC16clearUpdateRangeyyF">clearUpdateRange()</a>
  1184. </code>
  1185. </div>
  1186. <div class="height-container">
  1187. <div class="pointer-container"></div>
  1188. <section class="section">
  1189. <div class="pointer"></div>
  1190. <div class="abstract">
  1191. <p>Clears the state of the pending display redraw region as well as the dirtyLines set.</p>
  1192. </div>
  1193. <div class="declaration">
  1194. <h4>Declaration</h4>
  1195. <div class="language">
  1196. <p class="aside-title">Swift</p>
  1197. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">clearUpdateRange</span><span class="p">()</span></code></pre>
  1198. </div>
  1199. </div>
  1200. </section>
  1201. </div>
  1202. </li>
  1203. <li class="item">
  1204. <div>
  1205. <code>
  1206. <a name="/s:9SwiftTerm8TerminalC17getCursorLocationSi1x_Si1ytyF"></a>
  1207. <a name="//apple_ref/swift/Method/getCursorLocation()" class="dashAnchor"></a>
  1208. <a class="token" href="#/s:9SwiftTerm8TerminalC17getCursorLocationSi1x_Si1ytyF">getCursorLocation()</a>
  1209. </code>
  1210. </div>
  1211. <div class="height-container">
  1212. <div class="pointer-container"></div>
  1213. <section class="section">
  1214. <div class="pointer"></div>
  1215. <div class="abstract">
  1216. <p>Zero-based (row, column) of cursor location relative to visible part of display.
  1217. Returns: a tuple, where the first element contains the column (x) and the second the row (y) where the cursor is.</p>
  1218. </div>
  1219. <div class="declaration">
  1220. <h4>Declaration</h4>
  1221. <div class="language">
  1222. <p class="aside-title">Swift</p>
  1223. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getCursorLocation</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="nv">x</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
  1224. </div>
  1225. </div>
  1226. </section>
  1227. </div>
  1228. </li>
  1229. <li class="item">
  1230. <div>
  1231. <code>
  1232. <a name="/s:9SwiftTerm8TerminalC16getTopVisibleRowSiyF"></a>
  1233. <a name="//apple_ref/swift/Method/getTopVisibleRow()" class="dashAnchor"></a>
  1234. <a class="token" href="#/s:9SwiftTerm8TerminalC16getTopVisibleRowSiyF">getTopVisibleRow()</a>
  1235. </code>
  1236. </div>
  1237. <div class="height-container">
  1238. <div class="pointer-container"></div>
  1239. <section class="section">
  1240. <div class="pointer"></div>
  1241. <div class="abstract">
  1242. <p>Returns the uppermost visible row on the terminal buffer</p>
  1243. </div>
  1244. <div class="declaration">
  1245. <h4>Declaration</h4>
  1246. <div class="language">
  1247. <p class="aside-title">Swift</p>
  1248. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getTopVisibleRow</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Int</span></code></pre>
  1249. </div>
  1250. </div>
  1251. </section>
  1252. </div>
  1253. </li>
  1254. <li class="item">
  1255. <div>
  1256. <code>
  1257. <a name="/s:9SwiftTerm8TerminalC19resetToInitialStateyyF"></a>
  1258. <a name="//apple_ref/swift/Method/resetToInitialState()" class="dashAnchor"></a>
  1259. <a class="token" href="#/s:9SwiftTerm8TerminalC19resetToInitialStateyyF">resetToInitialState()</a>
  1260. </code>
  1261. </div>
  1262. <div class="height-container">
  1263. <div class="pointer-container"></div>
  1264. <section class="section">
  1265. <div class="pointer"></div>
  1266. <div class="abstract">
  1267. <p>This performs a full reset of the terminal, like a soft reset, but additionally resets the buffer conents and scroll area.
  1268. for a soft reset see <code>softReset</code></p>
  1269. </div>
  1270. <div class="declaration">
  1271. <h4>Declaration</h4>
  1272. <div class="language">
  1273. <p class="aside-title">Swift</p>
  1274. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">resetToInitialState</span><span class="p">()</span></code></pre>
  1275. </div>
  1276. </div>
  1277. </section>
  1278. </div>
  1279. </li>
  1280. <li class="item">
  1281. <div>
  1282. <code>
  1283. <a name="/s:9SwiftTerm8TerminalC6scroll9isWrappedySb_tF"></a>
  1284. <a name="//apple_ref/swift/Method/scroll(isWrapped:)" class="dashAnchor"></a>
  1285. <a class="token" href="#/s:9SwiftTerm8TerminalC6scroll9isWrappedySb_tF">scroll(isWrapped:<wbr>)</a>
  1286. </code>
  1287. </div>
  1288. <div class="height-container">
  1289. <div class="pointer-container"></div>
  1290. <section class="section">
  1291. <div class="pointer"></div>
  1292. <div class="abstract">
  1293. <p>Undocumented</p>
  1294. </div>
  1295. <div class="declaration">
  1296. <h4>Declaration</h4>
  1297. <div class="language">
  1298. <p class="aside-title">Swift</p>
  1299. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">scroll</span><span class="p">(</span><span class="nv">isWrapped</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">)</span></code></pre>
  1300. </div>
  1301. </div>
  1302. </section>
  1303. </div>
  1304. </li>
  1305. <li class="item">
  1306. <div>
  1307. <code>
  1308. <a name="/s:9SwiftTerm8TerminalC12emitLineFeedyyF"></a>
  1309. <a name="//apple_ref/swift/Method/emitLineFeed()" class="dashAnchor"></a>
  1310. <a class="token" href="#/s:9SwiftTerm8TerminalC12emitLineFeedyyF">emitLineFeed()</a>
  1311. </code>
  1312. </div>
  1313. <div class="height-container">
  1314. <div class="pointer-container"></div>
  1315. <section class="section">
  1316. <div class="pointer"></div>
  1317. <div class="abstract">
  1318. <p>Undocumented</p>
  1319. </div>
  1320. <div class="declaration">
  1321. <h4>Declaration</h4>
  1322. <div class="language">
  1323. <p class="aside-title">Swift</p>
  1324. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">emitLineFeed</span><span class="p">()</span></code></pre>
  1325. </div>
  1326. </div>
  1327. </section>
  1328. </div>
  1329. </li>
  1330. <li class="item">
  1331. <div>
  1332. <code>
  1333. <a name="/s:9SwiftTerm8TerminalC6resize4cols4rowsySi_SitF"></a>
  1334. <a name="//apple_ref/swift/Method/resize(cols:rows:)" class="dashAnchor"></a>
  1335. <a class="token" href="#/s:9SwiftTerm8TerminalC6resize4cols4rowsySi_SitF">resize(cols:<wbr>rows:<wbr>)</a>
  1336. </code>
  1337. </div>
  1338. <div class="height-container">
  1339. <div class="pointer-container"></div>
  1340. <section class="section">
  1341. <div class="pointer"></div>
  1342. <div class="abstract">
  1343. <p>Undocumented</p>
  1344. </div>
  1345. <div class="declaration">
  1346. <h4>Declaration</h4>
  1347. <div class="language">
  1348. <p class="aside-title">Swift</p>
  1349. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">resize</span><span class="p">(</span><span class="nv">cols</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">rows</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
  1350. </div>
  1351. </div>
  1352. </section>
  1353. </div>
  1354. </li>
  1355. <li class="item">
  1356. <div>
  1357. <code>
  1358. <a name="/s:9SwiftTerm8TerminalC7refresh8startRow03endF0ySi_SitF"></a>
  1359. <a name="//apple_ref/swift/Method/refresh(startRow:endRow:)" class="dashAnchor"></a>
  1360. <a class="token" href="#/s:9SwiftTerm8TerminalC7refresh8startRow03endF0ySi_SitF">refresh(startRow:<wbr>endRow:<wbr>)</a>
  1361. </code>
  1362. </div>
  1363. <div class="height-container">
  1364. <div class="pointer-container"></div>
  1365. <section class="section">
  1366. <div class="pointer"></div>
  1367. <div class="abstract">
  1368. <p>Registers that the region between startRow and endRow was modified and needs to be updated by the</p>
  1369. </div>
  1370. <div class="declaration">
  1371. <h4>Declaration</h4>
  1372. <div class="language">
  1373. <p class="aside-title">Swift</p>
  1374. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">refresh</span><span class="p">(</span><span class="nv">startRow</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">endRow</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
  1375. </div>
  1376. </div>
  1377. </section>
  1378. </div>
  1379. </li>
  1380. <li class="item">
  1381. <div>
  1382. <code>
  1383. <a name="/s:9SwiftTerm8TerminalC10showCursoryyF"></a>
  1384. <a name="//apple_ref/swift/Method/showCursor()" class="dashAnchor"></a>
  1385. <a class="token" href="#/s:9SwiftTerm8TerminalC10showCursoryyF">showCursor()</a>
  1386. </code>
  1387. </div>
  1388. <div class="height-container">
  1389. <div class="pointer-container"></div>
  1390. <section class="section">
  1391. <div class="pointer"></div>
  1392. <div class="abstract">
  1393. <p>Undocumented</p>
  1394. </div>
  1395. <div class="declaration">
  1396. <h4>Declaration</h4>
  1397. <div class="language">
  1398. <p class="aside-title">Swift</p>
  1399. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">showCursor</span><span class="p">()</span></code></pre>
  1400. </div>
  1401. </div>
  1402. </section>
  1403. </div>
  1404. </li>
  1405. <li class="item">
  1406. <div>
  1407. <code>
  1408. <a name="/s:9SwiftTerm8TerminalC10hideCursoryyF"></a>
  1409. <a name="//apple_ref/swift/Method/hideCursor()" class="dashAnchor"></a>
  1410. <a class="token" href="#/s:9SwiftTerm8TerminalC10hideCursoryyF">hideCursor()</a>
  1411. </code>
  1412. </div>
  1413. <div class="height-container">
  1414. <div class="pointer-container"></div>
  1415. <section class="section">
  1416. <div class="pointer"></div>
  1417. <div class="abstract">
  1418. <p>Undocumented</p>
  1419. </div>
  1420. <div class="declaration">
  1421. <h4>Declaration</h4>
  1422. <div class="language">
  1423. <p class="aside-title">Swift</p>
  1424. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">hideCursor</span><span class="p">()</span></code></pre>
  1425. </div>
  1426. </div>
  1427. </section>
  1428. </div>
  1429. </li>
  1430. <li class="item">
  1431. <div>
  1432. <code>
  1433. <a name="/s:9SwiftTerm8TerminalC12encodeButton6button7release5shift4meta7controlS2i_S4btF"></a>
  1434. <a name="//apple_ref/swift/Method/encodeButton(button:release:shift:meta:control:)" class="dashAnchor"></a>
  1435. <a class="token" href="#/s:9SwiftTerm8TerminalC12encodeButton6button7release5shift4meta7controlS2i_S4btF">encodeButton(button:<wbr>release:<wbr>shift:<wbr>meta:<wbr>control:<wbr>)</a>
  1436. </code>
  1437. </div>
  1438. <div class="height-container">
  1439. <div class="pointer-container"></div>
  1440. <section class="section">
  1441. <div class="pointer"></div>
  1442. <div class="abstract">
  1443. <p>Encodes the button action in the format expected by the client</p>
  1444. </div>
  1445. <div class="declaration">
  1446. <h4>Declaration</h4>
  1447. <div class="language">
  1448. <p class="aside-title">Swift</p>
  1449. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">encodeButton</span><span class="p">(</span><span class="nv">button</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">release</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">,</span> <span class="nv">shift</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">,</span> <span class="nv">meta</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">,</span> <span class="nv">control</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Int</span></code></pre>
  1450. </div>
  1451. </div>
  1452. <div>
  1453. <h4>Parameters</h4>
  1454. <table class="graybox">
  1455. <tbody>
  1456. <tr>
  1457. <td>
  1458. <code>
  1459. <em>button</em>
  1460. </code>
  1461. </td>
  1462. <td>
  1463. <div>
  1464. <p>The button to encode</p>
  1465. </div>
  1466. </td>
  1467. </tr>
  1468. <tr>
  1469. <td>
  1470. <code>
  1471. <em>release</em>
  1472. </code>
  1473. </td>
  1474. <td>
  1475. <div>
  1476. <p><code>true</code> if this is a mouse release event</p>
  1477. </div>
  1478. </td>
  1479. </tr>
  1480. <tr>
  1481. <td>
  1482. <code>
  1483. <em>shift</em>
  1484. </code>
  1485. </td>
  1486. <td>
  1487. <div>
  1488. <p><code>true</code> if the shift key is pressed</p>
  1489. </div>
  1490. </td>
  1491. </tr>
  1492. <tr>
  1493. <td>
  1494. <code>
  1495. <em>meta</em>
  1496. </code>
  1497. </td>
  1498. <td>
  1499. <div>
  1500. <p><code>true</code> if the meta/alt key is pressed</p>
  1501. </div>
  1502. </td>
  1503. </tr>
  1504. <tr>
  1505. <td>
  1506. <code>
  1507. <em>control</em>
  1508. </code>
  1509. </td>
  1510. <td>
  1511. <div>
  1512. <p><code>true</code> if the control key is pressed</p>
  1513. </div>
  1514. </td>
  1515. </tr>
  1516. </tbody>
  1517. </table>
  1518. </div>
  1519. <div>
  1520. <h4>Return Value</h4>
  1521. <p>the encoded value</p>
  1522. </div>
  1523. </section>
  1524. </div>
  1525. </li>
  1526. <li class="item">
  1527. <div>
  1528. <code>
  1529. <a name="/s:9SwiftTerm8TerminalC9sendEvent11buttonFlags1x1yySi_S2itF"></a>
  1530. <a name="//apple_ref/swift/Method/sendEvent(buttonFlags:x:y:)" class="dashAnchor"></a>
  1531. <a class="token" href="#/s:9SwiftTerm8TerminalC9sendEvent11buttonFlags1x1yySi_S2itF">sendEvent(buttonFlags:<wbr>x:<wbr>y:<wbr>)</a>
  1532. </code>
  1533. </div>
  1534. <div class="height-container">
  1535. <div class="pointer-container"></div>
  1536. <section class="section">
  1537. <div class="pointer"></div>
  1538. <div class="abstract">
  1539. <p>Sends a mouse event for a specific button at the specific location</p>
  1540. </div>
  1541. <div class="declaration">
  1542. <h4>Declaration</h4>
  1543. <div class="language">
  1544. <p class="aside-title">Swift</p>
  1545. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">sendEvent</span><span class="p">(</span><span class="nv">buttonFlags</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">x</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
  1546. </div>
  1547. </div>
  1548. <div>
  1549. <h4>Parameters</h4>
  1550. <table class="graybox">
  1551. <tbody>
  1552. <tr>
  1553. <td>
  1554. <code>
  1555. <em>buttonFlags</em>
  1556. </code>
  1557. </td>
  1558. <td>
  1559. <div>
  1560. <p>Button flags encoded in Cb mode.</p>
  1561. </div>
  1562. </td>
  1563. </tr>
  1564. <tr>
  1565. <td>
  1566. <code>
  1567. <em>x</em>
  1568. </code>
  1569. </td>
  1570. <td>
  1571. <div>
  1572. <p>X coordinate for the event</p>
  1573. </div>
  1574. </td>
  1575. </tr>
  1576. <tr>
  1577. <td>
  1578. <code>
  1579. <em>y</em>
  1580. </code>
  1581. </td>
  1582. <td>
  1583. <div>
  1584. <p>Y coordinate for the event</p>
  1585. </div>
  1586. </td>
  1587. </tr>
  1588. </tbody>
  1589. </table>
  1590. </div>
  1591. </section>
  1592. </div>
  1593. </li>
  1594. <li class="item">
  1595. <div>
  1596. <code>
  1597. <a name="/s:9SwiftTerm8TerminalC10sendMotion11buttonFlags1x1yySi_S2itF"></a>
  1598. <a name="//apple_ref/swift/Method/sendMotion(buttonFlags:x:y:)" class="dashAnchor"></a>
  1599. <a class="token" href="#/s:9SwiftTerm8TerminalC10sendMotion11buttonFlags1x1yySi_S2itF">sendMotion(buttonFlags:<wbr>x:<wbr>y:<wbr>)</a>
  1600. </code>
  1601. </div>
  1602. <div class="height-container">
  1603. <div class="pointer-container"></div>
  1604. <section class="section">
  1605. <div class="pointer"></div>
  1606. <div class="abstract">
  1607. <p>Sends a mouse motion event for a specific button at the specific location</p>
  1608. </div>
  1609. <div class="declaration">
  1610. <h4>Declaration</h4>
  1611. <div class="language">
  1612. <p class="aside-title">Swift</p>
  1613. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">sendMotion</span><span class="p">(</span><span class="nv">buttonFlags</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">x</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
  1614. </div>
  1615. </div>
  1616. <div>
  1617. <h4>Parameters</h4>
  1618. <table class="graybox">
  1619. <tbody>
  1620. <tr>
  1621. <td>
  1622. <code>
  1623. <em>buttonFlags</em>
  1624. </code>
  1625. </td>
  1626. <td>
  1627. <div>
  1628. <p>Button flags encoded in Cb mode.</p>
  1629. </div>
  1630. </td>
  1631. </tr>
  1632. <tr>
  1633. <td>
  1634. <code>
  1635. <em>x</em>
  1636. </code>
  1637. </td>
  1638. <td>
  1639. <div>
  1640. <p>X coordinate for the event</p>
  1641. </div>
  1642. </td>
  1643. </tr>
  1644. <tr>
  1645. <td>
  1646. <code>
  1647. <em>y</em>
  1648. </code>
  1649. </td>
  1650. <td>
  1651. <div>
  1652. <p>Y coordinate for the event</p>
  1653. </div>
  1654. </td>
  1655. </tr>
  1656. </tbody>
  1657. </table>
  1658. </div>
  1659. </section>
  1660. </div>
  1661. </li>
  1662. <li class="item">
  1663. <div>
  1664. <code>
  1665. <a name="/s:9SwiftTerm8TerminalC8setTitle4textySS_tF"></a>
  1666. <a name="//apple_ref/swift/Method/setTitle(text:)" class="dashAnchor"></a>
  1667. <a class="token" href="#/s:9SwiftTerm8TerminalC8setTitle4textySS_tF">setTitle(text:<wbr>)</a>
  1668. </code>
  1669. </div>
  1670. <div class="height-container">
  1671. <div class="pointer-container"></div>
  1672. <section class="section">
  1673. <div class="pointer"></div>
  1674. <div class="abstract">
  1675. <p>Undocumented</p>
  1676. </div>
  1677. <div class="declaration">
  1678. <h4>Declaration</h4>
  1679. <div class="language">
  1680. <p class="aside-title">Swift</p>
  1681. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">setTitle</span><span class="p">(</span><span class="nv">text</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
  1682. </div>
  1683. </div>
  1684. </section>
  1685. </div>
  1686. </li>
  1687. <li class="item">
  1688. <div>
  1689. <code>
  1690. <a name="/s:9SwiftTerm8TerminalC12setIconTitle4textySS_tF"></a>
  1691. <a name="//apple_ref/swift/Method/setIconTitle(text:)" class="dashAnchor"></a>
  1692. <a class="token" href="#/s:9SwiftTerm8TerminalC12setIconTitle4textySS_tF">setIconTitle(text:<wbr>)</a>
  1693. </code>
  1694. </div>
  1695. <div class="height-container">
  1696. <div class="pointer-container"></div>
  1697. <section class="section">
  1698. <div class="pointer"></div>
  1699. <div class="abstract">
  1700. <p>Undocumented</p>
  1701. </div>
  1702. <div class="declaration">
  1703. <h4>Declaration</h4>
  1704. <div class="language">
  1705. <p class="aside-title">Swift</p>
  1706. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">setIconTitle</span><span class="p">(</span><span class="nv">text</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
  1707. </div>
  1708. </div>
  1709. </section>
  1710. </div>
  1711. </li>
  1712. <li class="item">
  1713. <div>
  1714. <code>
  1715. <a name="/s:9SwiftTerm8TerminalC23getEnvironmentVariables8termName9trueColorSaySSGSSSg_SbtFZ"></a>
  1716. <a name="//apple_ref/swift/Method/getEnvironmentVariables(termName:trueColor:)" class="dashAnchor"></a>
  1717. <a class="token" href="#/s:9SwiftTerm8TerminalC23getEnvironmentVariables8termName9trueColorSaySSGSSSg_SbtFZ">getEnvironmentVariables(termName:<wbr>trueColor:<wbr>)</a>
  1718. </code>
  1719. </div>
  1720. <div class="height-container">
  1721. <div class="pointer-container"></div>
  1722. <section class="section">
  1723. <div class="pointer"></div>
  1724. <div class="abstract">
  1725. <p>Provides a baseline set of environment variables that would be useful to run the terminal,
  1726. you can customzie these accordingly.</p>
  1727. </div>
  1728. <div class="declaration">
  1729. <h4>Declaration</h4>
  1730. <div class="language">
  1731. <p class="aside-title">Swift</p>
  1732. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">getEnvironmentVariables</span><span class="p">(</span><span class="nv">termName</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">trueColor</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt">String</span><span class="p">]</span></code></pre>
  1733. </div>
  1734. </div>
  1735. <div>
  1736. <h4>Return Value</h4>
  1737. <p>an array of default environment variables that include TERM set to the specified value, or xterm-256color,
  1738. and if trueColor is true, COLORTERM=truecolor, the LANG=en_US.UTF-8 and it mirrors the currently set values
  1739. for LOGNAME, USER, DISPLAY, LC_TYPE, USER and HOME.</p>
  1740. </div>
  1741. </section>
  1742. </div>
  1743. </li>
  1744. <li class="item">
  1745. <div>
  1746. <code>
  1747. <a name="/s:9SwiftTerm8TerminalC10BufferKindO"></a>
  1748. <a name="//apple_ref/swift/Enum/BufferKind" class="dashAnchor"></a>
  1749. <a class="token" href="#/s:9SwiftTerm8TerminalC10BufferKindO">BufferKind</a>
  1750. </code>
  1751. </div>
  1752. <div class="height-container">
  1753. <div class="pointer-container"></div>
  1754. <section class="section">
  1755. <div class="pointer"></div>
  1756. <div class="abstract">
  1757. <p>Specified the kind of buffer is being requested from the terminal</p>
  1758. <a href="../Classes/Terminal/BufferKind.html" class="slightly-smaller">See more</a>
  1759. </div>
  1760. <div class="declaration">
  1761. <h4>Declaration</h4>
  1762. <div class="language">
  1763. <p class="aside-title">Swift</p>
  1764. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">BufferKind</span></code></pre>
  1765. </div>
  1766. </div>
  1767. </section>
  1768. </div>
  1769. </li>
  1770. <li class="item">
  1771. <div>
  1772. <code>
  1773. <a name="/s:9SwiftTerm8TerminalC15getBufferAsData4kind8encoding10Foundation0G0VAC0E4KindO_SSAGE8EncodingVtF"></a>
  1774. <a name="//apple_ref/swift/Method/getBufferAsData(kind:encoding:)" class="dashAnchor"></a>
  1775. <a class="token" href="#/s:9SwiftTerm8TerminalC15getBufferAsData4kind8encoding10Foundation0G0VAC0E4KindO_SSAGE8EncodingVtF">getBufferAsData(kind:<wbr>encoding:<wbr>)</a>
  1776. </code>
  1777. </div>
  1778. <div class="height-container">
  1779. <div class="pointer-container"></div>
  1780. <section class="section">
  1781. <div class="pointer"></div>
  1782. <div class="abstract">
  1783. <p>Returns the contents of the specified terminal buffer encoded as UTF8 in the provided Data buffer</p>
  1784. </div>
  1785. <div class="declaration">
  1786. <h4>Declaration</h4>
  1787. <div class="language">
  1788. <p class="aside-title">Swift</p>
  1789. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getBufferAsData</span><span class="p">(</span><span class="nv">kind</span><span class="p">:</span> <span class="kt"><a href="../Classes/Terminal/BufferKind.html">BufferKind</a></span> <span class="o">=</span> <span class="o">.</span><span class="n">active</span><span class="p">,</span> <span class="nv">encoding</span><span class="p">:</span> <span class="kt">String</span><span class="o">.</span><span class="kt">Encoding</span> <span class="o">=</span> <span class="o">.</span><span class="n">utf8</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Data</span></code></pre>
  1790. </div>
  1791. </div>
  1792. <div>
  1793. <h4>Parameters</h4>
  1794. <table class="graybox">
  1795. <tbody>
  1796. <tr>
  1797. <td>
  1798. <code>
  1799. <em>kind</em>
  1800. </code>
  1801. </td>
  1802. <td>
  1803. <div>
  1804. <p>which buffer to retrive the data for</p>
  1805. </div>
  1806. </td>
  1807. </tr>
  1808. <tr>
  1809. <td>
  1810. <code>
  1811. <em>encoding</em>
  1812. </code>
  1813. </td>
  1814. <td>
  1815. <div>
  1816. <p>which encoding to use for the returned value, defaults to utf8</p>
  1817. </div>
  1818. </td>
  1819. </tr>
  1820. </tbody>
  1821. </table>
  1822. </div>
  1823. </section>
  1824. </div>
  1825. </li>
  1826. </ul>
  1827. </div>
  1828. </section>
  1829. </section>
  1830. <section id="footer">
  1831. <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>
  1832. <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>
  1833. </section>
  1834. </article>
  1835. </div>
  1836. </body>
  1837. </div>
  1838. </html>