2022-12-15 04:00:54 +00:00
|
|
|
---
|
|
|
|
title: Module terminal
|
|
|
|
description: low level terminal library
|
|
|
|
layout: doc
|
|
|
|
menu:
|
|
|
|
docs:
|
|
|
|
parent: "API"
|
|
|
|
---
|
|
|
|
|
|
|
|
## Introduction
|
|
|
|
The terminal library is a simple and lower level library for certain terminal interactions.
|
|
|
|
|
|
|
|
## Functions
|
2023-09-02 18:18:40 +00:00
|
|
|
|||
|
|
|
|
|----|----|
|
|
|
|
|<a href="#restoreState">restoreState()</a>|Restores the last saved state of the terminal|
|
2023-12-04 00:54:00 +00:00
|
|
|
|<a href="#saveState">saveState()</a>|Saves the current state of the terminal.|
|
|
|
|
|<a href="#setRaw">setRaw()</a>|Puts the terminal into raw mode.|
|
2023-09-02 18:18:40 +00:00
|
|
|
|<a href="#size">size()</a>|Gets the dimensions of the terminal. Returns a table with `width` and `height`|
|
|
|
|
|
|
|
|
<hr><div id='restoreState'>
|
|
|
|
<h4 class='heading'>
|
|
|
|
terminal.restoreState()
|
|
|
|
<a href="#restoreState" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
|
|
|
|
2023-12-02 12:23:49 +00:00
|
|
|
Restores the last saved state of the terminal
|
2023-08-26 15:30:51 +00:00
|
|
|
#### Parameters
|
|
|
|
This function has no parameters.
|
2023-09-02 20:01:57 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr><div id='saveState'>
|
2023-09-02 18:18:40 +00:00
|
|
|
<h4 class='heading'>
|
|
|
|
terminal.saveState()
|
|
|
|
<a href="#saveState" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
2022-12-15 04:00:54 +00:00
|
|
|
|
2023-12-04 00:54:00 +00:00
|
|
|
Saves the current state of the terminal.
|
2023-08-26 15:30:51 +00:00
|
|
|
#### Parameters
|
|
|
|
This function has no parameters.
|
2023-09-02 20:01:57 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr><div id='setRaw'>
|
2023-09-02 18:18:40 +00:00
|
|
|
<h4 class='heading'>
|
|
|
|
terminal.setRaw()
|
|
|
|
<a href="#setRaw" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
2022-12-15 04:00:54 +00:00
|
|
|
|
2023-12-04 00:54:00 +00:00
|
|
|
Puts the terminal into raw mode.
|
2023-08-26 15:30:51 +00:00
|
|
|
#### Parameters
|
|
|
|
This function has no parameters.
|
2023-09-02 20:01:57 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr><div id='size'>
|
2023-09-02 18:18:40 +00:00
|
|
|
<h4 class='heading'>
|
|
|
|
terminal.size()
|
|
|
|
<a href="#size" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
2022-12-15 04:00:54 +00:00
|
|
|
|
2023-12-02 12:23:49 +00:00
|
|
|
Gets the dimensions of the terminal. Returns a table with `width` and `height`
|
2023-12-04 00:54:00 +00:00
|
|
|
NOTE: The size refers to the amount of columns and rows of text that can fit in the terminal.
|
2023-08-26 15:30:51 +00:00
|
|
|
#### Parameters
|
|
|
|
This function has no parameters.
|
2023-09-02 20:01:57 +00:00
|
|
|
</div>
|
|
|
|
|