---
name: "screen.lua"
section: "8"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/screen.lua"
---

# screen.lua(8)

bootloader screen manipulation module

## NAME

**screen.lua** – bootloader screen manipulation module

## DESCRIPTION

**screen.lua** contains functionality for manipulating the screen. This includes functionality such as clearing the screen, moving the cursor, and setting foreground/background colors using sequences provided by [color.lua(8)](/color.lua/8.md).

Before using the functionality provided by **screen.lua**, it must be included with a statement such as the following:

```
local screen = require("screen")
```

The following variables are exported from **screen.lua**:

- **screen.default\_x**

  The x component of the default cursor position.

- **screen.default\_y**

  The y component of the default cursor position.

The following functions are exported from **screen.lua**:

- **screen.clear**()

  Clears the screen. **screen.clear**() will do nothing if a serial boot is detected.

- **screen.setcursor**(*x*, *y*)

  Sets the cursor position to *x*, *y*. **screen.setcursor**() will do nothing if a serial boot is detected.

- **screen.setforeground**(*color\_value*)

  Sets the foreground color to *color\_value*, which should be a constant defined in [color.lua(8)](/color.lua/8.md). **screen.setforeground**() will do nothing if color is disabled.

- **screen.setbackground**(*color\_value*)

  Sets the background color to *color\_value*, which should be a constant defined in [color.lua(8)](/color.lua/8.md). **screen.setbackground**() will do nothing if color is disabled.

- **screen.defcolor**()

  Sets the default color scheme, as defined by **color.default**(). **screen.defcolor**() will do nothing if color is disabled.

- **screen.defcursor**()

  Sets the default cursor position to that defined by **screen.default\_x**, **screen.default\_y**.

## SEE ALSO

[color.lua(8)](/color.lua/8.md)

## AUTHORS

The **screen.lua** file was originally written by Pedro Souza ⟨*pedrosouza@FreeBSD.org*⟩. Later work and this manual page was done by Kyle Evans ⟨*kevans@FreeBSD.org*⟩.
