Files
Nim/linenoise.html
github-actions[bot] c7440eccf2 Deploy to GitHub pages
2025-09-27 04:02:34 +00:00

397 lines
32 KiB
HTML

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>std/linenoise</title>
<!-- Google fonts -->
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
<!-- Favicon -->
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
<!-- JS -->
<script type="text/javascript" src="dochack.js?v=2.3.1"></script>
</head>
<body>
<div class="document" id="documentId">
<div class="container">
<h1 class="title">std/linenoise</h1>
<div class="row">
<div class="three columns">
<div class="theme-select-wrapper">
<label for="theme-select">Theme:&nbsp;</label>
<select id="theme-select" onchange="setTheme(this.value)">
<option value="auto">🌗 Match OS</option>
<option value="dark">🌑 Dark</option>
<option value="light">🌕 Light</option>
</select>
</div>
<div id="global-links">
<ul class="simple-boot">
<li><a href="manual.html">Manual</a></li>
<li><a href="lib.html">Standard library</a></li>
<li> <a id="indexLink" href="theindex.html">Index</a></li>
<li><a href="compiler/theindex.html">Compiler docs</a></li>
<li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
<li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
</ul>
</div>
<div id="searchInputDiv">
Search: <input type="search" id="searchInput"
oninput="search()" />
</div>
<ul class="simple simple-toc" id="toc-list">
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#CompletionCallback" title="CompletionCallback = proc (a2: cstring; a3: ptr Completions) {.cdecl.}">CompletionCallback</a></li>
<li><a class="reference" href="#Completions" title="Completions = object
len*: csize_t
cvec*: cstringArray">Completions</a></li>
<li><a class="reference" href="#LinenoiseData" title="LinenoiseData = object">LinenoiseData</a></li>
<li><a class="reference" href="#ReadLineResult" title="ReadLineResult = object
line*: string
status*: Status">ReadLineResult</a></li>
<li><a class="reference" href="#Status" title="Status = enum
lnCtrlUnkown, lnCtrlC, lnCtrlD">Status</a></li>
</ul>
</details>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
<ul class="simple simple-toc-section">
<ul class="simple nested-toc-section">addCompletion
<li><a class="reference" href="#addCompletion%2Cptr.Completions%2Ccstring" title="addCompletion(a2: ptr Completions; a3: cstring)">addCompletion(a2: ptr Completions; a3: cstring)</a></li>
</ul>
<ul class="simple nested-toc-section">clearScreen
<li><a class="reference" href="#clearScreen" title="clearScreen()">clearScreen()</a></li>
</ul>
<ul class="simple nested-toc-section">free
<li><a class="reference" href="#free%2Ccstring" title="free(s: cstring)">free(s: cstring)</a></li>
</ul>
<ul class="simple nested-toc-section">historyAdd
<li><a class="reference" href="#historyAdd%2Ccstring" title="historyAdd(line: cstring): cint">historyAdd(line: cstring): cint</a></li>
</ul>
<ul class="simple nested-toc-section">historyLoad
<li><a class="reference" href="#historyLoad%2Ccstring" title="historyLoad(filename: cstring): cint">historyLoad(filename: cstring): cint</a></li>
</ul>
<ul class="simple nested-toc-section">historySave
<li><a class="reference" href="#historySave%2Ccstring" title="historySave(filename: cstring): cint">historySave(filename: cstring): cint</a></li>
</ul>
<ul class="simple nested-toc-section">historySetMaxLen
<li><a class="reference" href="#historySetMaxLen%2Ccint" title="historySetMaxLen(len: cint): cint">historySetMaxLen(len: cint): cint</a></li>
</ul>
<ul class="simple nested-toc-section">printKeyCodes
<li><a class="reference" href="#printKeyCodes" title="printKeyCodes()">printKeyCodes()</a></li>
</ul>
<ul class="simple nested-toc-section">readLine
<li><a class="reference" href="#readLine%2Ccstring" title="readLine(prompt: cstring): cstring">readLine(prompt: cstring): cstring</a></li>
</ul>
<ul class="simple nested-toc-section">readLineStatus
<li><a class="reference" href="#readLineStatus%2Cstring%2CReadLineResult" title="readLineStatus(prompt: string; result: var ReadLineResult)">readLineStatus(prompt: string; result: var ReadLineResult)</a></li>
</ul>
<ul class="simple nested-toc-section">setCompletionCallback
<li><a class="reference" href="#setCompletionCallback%2CCompletionCallback" title="setCompletionCallback(a2: CompletionCallback)">setCompletionCallback(a2: CompletionCallback)</a></li>
</ul>
<ul class="simple nested-toc-section">setMultiLine
<li><a class="reference" href="#setMultiLine%2Ccint" title="setMultiLine(ml: cint)">setMultiLine(ml: cint)</a></li>
</ul>
</ul>
</details>
</li>
</ul>
</div>
<div class="nine columns" id="content">
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
<div id="tocRoot"></div>
<p class="module-desc"></p>
<div class="section" id="7">
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="CompletionCallback">
<dt><pre><a href="linenoise.html#CompletionCallback"><span class="Identifier">CompletionCallback</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">a2</span><span class="Other">:</span> <a href="system.html#cstring"><span class="Identifier">cstring</span></a><span class="Other">;</span> <span class="Identifier">a3</span><span class="Other">:</span> <span class="Keyword">ptr</span> <a href="linenoise.html#Completions"><span class="Identifier">Completions</span></a><span class="Other">)</span> {.<span class="Identifier">cdecl</span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L15" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L15" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="Completions">
<dt><pre><a href="linenoise.html#Completions"><span class="Identifier">Completions</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">len</span><span class="Operator">*</span><span class="Other">:</span> <a href="ctypes.html#csize_t"><span class="Identifier">csize_t</span></a>
<span class="Identifier">cvec</span><span class="Operator">*</span><span class="Other">:</span> <a href="ctypes.html#cstringArray"><span class="Identifier">cstringArray</span></a></pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L11" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L11" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="LinenoiseData">
<dt><pre><a href="linenoise.html#LinenoiseData"><span class="Identifier">LinenoiseData</span></a> <span class="Other">=</span> <span class="Keyword">object</span></pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L42" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L42" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="ReadLineResult">
<dt><pre><a href="linenoise.html#ReadLineResult"><span class="Identifier">ReadLineResult</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">line</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a>
<span class="Identifier">status</span><span class="Operator">*</span><span class="Other">:</span> <a href="linenoise.html#Status"><span class="Identifier">Status</span></a></pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L53" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L53" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="Status">
<dt><pre><a href="linenoise.html#Status"><span class="Identifier">Status</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
<span class="Identifier">lnCtrlUnkown</span><span class="Other">,</span> <span class="Identifier">lnCtrlC</span><span class="Other">,</span> <span class="Identifier">lnCtrlD</span></pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L48" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L48" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</dl>
</div>
<div class="section" id="12">
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<div id="addCompletion-procs-all">
<div id="addCompletion,ptr.Completions,cstring">
<dt><pre><span class="Keyword">proc</span> <a href="#addCompletion%2Cptr.Completions%2Ccstring"><span class="Identifier">addCompletion</span></a><span class="Other">(</span><span class="Identifier">a2</span><span class="Other">:</span> <span class="Keyword">ptr</span> <a href="linenoise.html#Completions"><span class="Identifier">Completions</span></a><span class="Other">;</span> <span class="Identifier">a3</span><span class="Other">:</span> <a href="system.html#cstring"><span class="Identifier">cstring</span></a><span class="Other">)</span> {.
<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;linenoiseAddCompletion&quot;</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L21" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L21" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="clearScreen-procs-all">
<div id="clearScreen">
<dt><pre><span class="Keyword">proc</span> <a href="#clearScreen"><span class="Identifier">clearScreen</span></a><span class="Other">(</span><span class="Other">)</span> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;linenoiseClearScreen&quot;</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L29" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L29" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="free-procs-all">
<div id="free,cstring">
<dt><pre><span class="Keyword">proc</span> <a href="#free%2Ccstring"><span class="Identifier">free</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="system.html#cstring"><span class="Identifier">cstring</span></a><span class="Other">)</span> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;free&quot;</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">&quot;&lt;stdlib.h&gt;&quot;</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L33" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L33" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="historyAdd-procs-all">
<div id="historyAdd,cstring">
<dt><pre><span class="Keyword">proc</span> <a href="#historyAdd%2Ccstring"><span class="Identifier">historyAdd</span></a><span class="Other">(</span><span class="Identifier">line</span><span class="Other">:</span> <a href="system.html#cstring"><span class="Identifier">cstring</span></a><span class="Other">)</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;linenoiseHistoryAdd&quot;</span><span class="Other">,</span>
<span class="Identifier">discardable</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L24" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L24" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="historyLoad-procs-all">
<div id="historyLoad,cstring">
<dt><pre><span class="Keyword">proc</span> <a href="#historyLoad%2Ccstring"><span class="Identifier">historyLoad</span></a><span class="Other">(</span><span class="Identifier">filename</span><span class="Other">:</span> <a href="system.html#cstring"><span class="Identifier">cstring</span></a><span class="Other">)</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;linenoiseHistoryLoad&quot;</span><span class="Other">,</span>
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L28" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L28" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="historySave-procs-all">
<div id="historySave,cstring">
<dt><pre><span class="Keyword">proc</span> <a href="#historySave%2Ccstring"><span class="Identifier">historySave</span></a><span class="Other">(</span><span class="Identifier">filename</span><span class="Other">:</span> <a href="system.html#cstring"><span class="Identifier">cstring</span></a><span class="Other">)</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;linenoiseHistorySave&quot;</span><span class="Other">,</span>
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L27" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L27" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="historySetMaxLen-procs-all">
<div id="historySetMaxLen,cint">
<dt><pre><span class="Keyword">proc</span> <a href="#historySetMaxLen%2Ccint"><span class="Identifier">historySetMaxLen</span></a><span class="Other">(</span><span class="Identifier">len</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a><span class="Other">)</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;linenoiseHistorySetMaxLen&quot;</span><span class="Other">,</span>
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L26" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L26" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="printKeyCodes-procs-all">
<div id="printKeyCodes">
<dt><pre><span class="Keyword">proc</span> <a href="#printKeyCodes"><span class="Identifier">printKeyCodes</span></a><span class="Other">(</span><span class="Other">)</span> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;linenoisePrintKeyCodes&quot;</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L31" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L31" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="readLine-procs-all">
<div id="readLine,cstring">
<dt><pre><span class="Keyword">proc</span> <a href="#readLine%2Ccstring"><span class="Identifier">readLine</span></a><span class="Other">(</span><span class="Identifier">prompt</span><span class="Other">:</span> <a href="system.html#cstring"><span class="Identifier">cstring</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#cstring"><span class="Identifier">cstring</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;linenoise&quot;</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L23" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L23" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="readLineStatus-procs-all">
<div id="readLineStatus,string,ReadLineResult">
<dt><pre><span class="Keyword">proc</span> <a href="#readLineStatus%2Cstring%2CReadLineResult"><span class="Identifier">readLineStatus</span></a><span class="Other">(</span><span class="Identifier">prompt</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">result</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="linenoise.html#ReadLineResult"><span class="Identifier">ReadLineResult</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
line editing API that allows returning the line entered and an indicator of which control key was entered, allowing user to distinguish between for example ctrl-C vs ctrl-D.
<p><strong class="examples_text">Example: cmd: -r:off</strong></p>
<pre class="listing"><span class="Keyword">var</span> <span class="Identifier">ret</span><span class="Punctuation">:</span> <span class="Identifier">ReadLineResult</span>
<span class="Keyword">while</span> <span class="Identifier">true</span><span class="Punctuation">:</span>
<span class="Identifier">readLineStatus</span><span class="Punctuation">(</span><span class="StringLit">&quot;name: &quot;</span><span class="Punctuation">,</span> <span class="Identifier">ret</span><span class="Punctuation">)</span> <span class="Comment"># ctrl-D will exit, ctrl-C will go to next prompt</span>
<span class="Keyword">if</span> <span class="Identifier">ret</span><span class="Operator">.</span><span class="Identifier">line</span><span class="Operator">.</span><span class="Identifier">len</span> <span class="Operator">&gt;</span> <span class="DecNumber">0</span><span class="Punctuation">:</span> <span class="Identifier">echo</span> <span class="Identifier">ret</span><span class="Operator">.</span><span class="Identifier">line</span>
<span class="Keyword">if</span> <span class="Identifier">ret</span><span class="Operator">.</span><span class="Identifier">status</span> <span class="Operator">==</span> <span class="Identifier">lnCtrlD</span><span class="Punctuation">:</span> <span class="Keyword">break</span>
<span class="Identifier">echo</span> <span class="StringLit">&quot;exiting&quot;</span></pre>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L57" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L57" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="setCompletionCallback-procs-all">
<div id="setCompletionCallback,CompletionCallback">
<dt><pre><span class="Keyword">proc</span> <a href="#setCompletionCallback%2CCompletionCallback"><span class="Identifier">setCompletionCallback</span></a><span class="Other">(</span><span class="Identifier">a2</span><span class="Other">:</span> <a href="linenoise.html#CompletionCallback"><span class="Identifier">CompletionCallback</span></a><span class="Other">)</span> {.
<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;linenoiseSetCompletionCallback&quot;</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L19" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L19" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="setMultiLine-procs-all">
<div id="setMultiLine,cint">
<dt><pre><span class="Keyword">proc</span> <a href="#setMultiLine%2Ccint"><span class="Identifier">setMultiLine</span></a><span class="Other">(</span><span class="Identifier">ml</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a><span class="Other">)</span> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;linenoiseSetMultiLine&quot;</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/wrappers/linenoise/linenoise.nim#L30" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/linenoise/linenoise.nim#L30" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
</dl>
</div>
</div>
</div>
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br>
<small style="color: var(--hint);">Made with Nim. Generated: 2025-09-27 04:01:47 UTC</small>
</div>
</div>
</div>
<script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
</body>
</html>