A small library for accesing the terminal from Lua
termview.new(x, y, w, h)
- Creates a new windowtermview.beep()
- Beeptermview.flash()
- Flashes the screentermview.flush()
- Flushes the screentermview.defColor(i, r, g, b)
- Defines a new colortermview.resizeWindow(w, h)
- Resizes the terminal window
view:x()
- Returns the x positionview:y()
- Returns the y positionview:w()
- Returns the widthview:h()
- Returns the heightview:move(x, y)
- Moves the viewview:resize(w, h)
- Resizes the viewview:setStyle(fg_col, bg_col, vid_mode)
- Sets the current text styleview:setBGStyle(fg_col, bg_col, vid_mode)
- Sets the background styleview:show()
- Shows a previously hidden viewview:hide()
- Hides a viewview:isHidden()
- Returns true if it's hiddenview:toTop()
- Moves the view to the top of the stackview:toBottom()
- Moves the view to the bottom of the stackview:curX()
- Returns the cursor's x positionview:curY()
- Returns the cursor's y positionview:getCursor()
- Returns the cursor's positionview:setCursor(x, y)
- Sets the cursor's positionview:moveCursor(dx, dy)
- Moves the cursor by the specified ammountview:border()
- Draws a border on the viewview:vline(x, y, h)
- Draws a vertical lineview:hline(x, y, w)
- Draws a horizontal lineview:touch()
- Forces a redraw of the viewview:clear()
- Clears the viewview:clearLine(i)
- Clears the ith lineview:setScroll(scroll)
- Sets if the view can scrollview:scroll(i)
- Scrolls the view by i linesview:copy(src, sx, sy, dx, dy, dw, dh)
- Copies from thesrc
to thedst
viewview:getc()
- Reads a character fromstdin
view:gets(max_len)
- Reads a string fromstdin
view:insc(char)
- Inserts a characterview:putc(char)
- Writes a characterview:puts(str)
- Writes a stringview:printf(str, ...)
- Writes a string (works likestring.format
)