Terminal interaction helpers for cursor control, line editing, and screen-aware text output.
- Repository:
opencomputers - System:
openos - Type:
library
OpenComputers/src\main\resources\assets\opencomputers\loot\openos\lib\term.lua
local term = require("term")- Description: Bind terminal output to a specific GPU, optionally scoped to a window object.
- Parameters:
gpuwindow
term.bind(nil, nil)- Description: Erase the current line and reset the cursor to its first column.
term.clearLine()- Description: Return whether cursor blinking is currently enabled.
term.getCursorBlink()- Description: Return the absolute screen rectangle occupied by the current terminal viewport.
term.getGlobalArea()- Description: Wait for input or other events while keeping the terminal cursor state refreshed.
- Parameters:
...
term.pull(nil)- Description: Read an editable input line with optional history, completion hints, password masking, or validation filtering.
- Parameters:
historydobreakhintpwcharfilter
term.read(nil, nil, 0, nil, nil)- Description: Enable or disable cursor blinking.
- Parameters:
enabled
term.setCursorBlink(nil)- Description: Write text to the terminal, optionally wrapping lines to the viewport width.
- Parameters:
valuewrap
term.write(nil, nil)- Different systems expose different subsets of the terminal API, but all variants revolve around cursor state, interactive reading, and writing through the active screen and GPU pair.