<ahref=#interface-fieldsclass=heading-link><iclass="fas fa-paperclip"></i></a></h3><ul><li><code>ver</code>: The version of Hilbish</li><li><code>goVersion</code>: The version of Go that Hilbish was compiled with</li><li><code>user</code>: Username of the user</li><li><code>host</code>: Hostname of the machine</li><li><code>dataDir</code>: Directory for Hilbish data files, including the docs and default modules</li><li><code>interactive</code>: Is Hilbish in an interactive shell?</li><li><code>login</code>: Is Hilbish the login shell?</li><li><code>vimMode</code>: Current Vim input mode of Hilbish (will be nil if not in Vim input mode)</li><li><code>exitCode</code>: xit code of the last executed command</li></ul><h3id=functionsclass=heading>Functions
<ahref=#aliascmd-origclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Sets an alias of <code>cmd</code> to <code>orig</code></p><h4id=appendpathdirclass=heading>appendPath(dir)
<ahref=#appendpathdirclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Appends <code>dir</code> to $PATH</p><h4id=completescope-cbclass=heading>complete(scope, cb)
<ahref=#completescope-cbclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Registers a completion handler for <code>scope</code>.
Check <code>doc completions</code> for more information.</p><h4id=cwd---stringclass=heading>cwd() -> string
<ahref=#cwd---stringclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Returns the current directory of the shell</p><h4id=execcmdclass=heading>exec(cmd)
<ahref=#execcmdclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Replaces running hilbish with <code>cmd</code></p><h4id=gorofnclass=heading>goro(fn)
<ahref=#gorofnclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Puts <code>fn</code> in a goroutine</p><h4id=highlighterlineclass=heading>highlighter(line)
<ahref=#highlighterlineclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Line highlighter handler. This is mainly for syntax highlighting, but in
<ahref=#hinterline-posclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>The command line hint handler. It gets called on every key insert to
override this function with your custom handler.</p><h4id=inputmodemodeclass=heading>inputMode(mode)
<ahref=#inputmodemodeclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Sets the input mode for Hilbish’s line reader. Accepts either emacs or vim</p><h4id=intervalcb-time---a-hrefhilbishdocsapihilbishhilbishtimerstimer-styletext-decoration-nonetimeraclass=heading>interval(cb, time) -> <ahref=/Hilbish/docs/api/hilbish/hilbish.timers/#timerstyle=text-decoration:none>Timer</a>
<ahref=#intervalcb-time---a-hrefhilbishdocsapihilbishhilbishtimerstimer-styletext-decoration-nonetimeraclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Runs the <code>cb</code> function every <code>time</code> milliseconds.
This creates a timer that starts immediately.</p><h4id=multipromptstrclass=heading>multiprompt(str)
<ahref=#multipromptstrclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Changes the continued line prompt to <code>str</code></p><h4id=prependpathdirclass=heading>prependPath(dir)
<ahref=#prependpathdirclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Prepends <code>dir</code> to $PATH</p><h4id=promptstr-typclass=heading>prompt(str, typ)
<ahref=#promptstr-typclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Changes the shell prompt to <code>str</code>
<code>%h</code> - Hostname of device</p><h4id=readprompt---input-stringclass=heading>read(prompt) -> input (string)
<ahref=#readprompt---input-stringclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Read input from the user, using Hilbish’s line editor/input reader.
Returns <code>input</code>, will be nil if ctrl + d is pressed, or an error occurs (which shouldn’t happen)</p><h4id=runcmd-returnout---exitcode-number-stdout-string-stderr-stringclass=heading>run(cmd, returnOut) -> exitCode (number), stdout (string), stderr (string)
<ahref=#runcmd-returnout---exitcode-number-stdout-string-stderr-stringclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Runs <code>cmd</code> in Hilbish’s sh interpreter.
3rd values instead of being outputted to the terminal.</p><h4id=runnermodemodeclass=heading>runnerMode(mode)
<ahref=#runnermodemodeclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Sets the execution/runner mode for interactive Hilbish. This determines whether
will call it to execute user input instead.</p><h4id=timeoutcb-time---a-hrefhilbishdocsapihilbishhilbishtimerstimer-styletext-decoration-nonetimeraclass=heading>timeout(cb, time) -> <ahref=/Hilbish/docs/api/hilbish/hilbish.timers/#timerstyle=text-decoration:none>Timer</a>
<ahref=#timeoutcb-time---a-hrefhilbishdocsapihilbishhilbishtimerstimer-styletext-decoration-nonetimeraclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Runs the <code>cb</code> function after <code>time</code> in milliseconds.
This creates a timer that starts immediately.</p><h4id=whichname---stringclass=heading>which(name) -> string
<ahref=#whichname---stringclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Checks if <code>name</code> is a valid command.
<ahref=#autoflushautoclass=heading-link><iclass="fas fa-paperclip"></i></a></h5><p>Sets/toggles the option of automatically flushing output.
A call with no argument will toggle the value.</p><h5id=flushclass=heading>flush()
<ahref=#flushclass=heading-link><iclass="fas fa-paperclip"></i></a></h5><p>Flush writes all buffered input to the sink.</p><h5id=read---stringclass=heading>read() -> string
<ahref=#read---stringclass=heading-link><iclass="fas fa-paperclip"></i></a></h5><p>Reads input from the sink.</p><h5id=writestrclass=heading>write(str)