pocketlang/docs/Reference/term.md
Thakee Nathees 5bc9dcad6b method bind implemented
- MethodBind type added.
- Now methods are first class and can be passed around as arguments
  store as a variable and return it from a function and they're first
  class callbales.
- Can bind instance to a method bind using .bind() method
- Class.methods() method added -> return a list of all methods as
  method binds
- Module.globals() method added -> returns a list of all globals
  of that module.
- Var._class -> attribute added which will return the class of the
  variable
- Class.name, MethodBind.name, Closure.name attribute and Modue._name
  attribute added
- Class._docs, Closure._docs, MethodBind._docs attribute added
- MethodBind.instance attribute added
2022-06-06 02:47:31 +05:30

1.3 KiB

term

init

term.init(capture_events:Bool) -> Null

Initialize terminal with raw mode for tui applications, set [capture_events] true to enable event handling.

cleanup

term.cleanup() -> Null

Cleanup and resotre the last terminal state.

isatty

term.isatty() -> Bool

Returns true if both stdin and stdout are tty.

new_screen_buffer

term.new_screen_buffer() -> Null

Switch to an alternative screen buffer.

restore_screen_buffer

term.restore_screen_buffer() -> Null

Restore the alternative buffer which was created with term.new_screen_buffer()

getsize

term.getsize() -> types.Vector

Returns the screen size.

getposition

term.getposition() -> types.Vector

Returns the cursor position in the screen on a zero based coordinate.

read_event

term.read_event(event:term.Event) -> Bool

Read an event and update the argument [event] and return true.If no event was read it'll return false.

Event

The terminal event type, that'll be used at term.read_event function to fetch events.

binary_mode

term.binary_mode() -> Null

On windows it'll set stdout to binary mode, on other platforms this function won't make make any difference.