---
name: "term_variables"
section: "3x"
platform: "macos"
package: "ncurses"
version: "79"
release: "macOS 26.5"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/term_variables/3x"
---

# term\_variables(3x)

curses terminfo global variables

## NAME

**SP**, **acs\_map**, **boolcodes**, **boolfnames**, **boolnames**, **cur\_term**, **numcodes**, **numfnames**, **numnames**, **strcodes**, **strfnames**, **strnames**, **ttytype** - **curses** terminfo global variables

## SYNOPSIS

```
#include <curses.h>
#include <term.h>
```

**chtype acs\_map\[\];**

**TERMINAL \* cur\_term;**

**char ttytype\[\];**

**NCURSES\_CONST char \* const \* boolcodes;**\
 **NCURSES\_CONST char \* const \* boolfnames;**\
 **NCURSES\_CONST char \* const \* boolnames;**

**NCURSES\_CONST char \* const \* numcodes;**\
 **NCURSES\_CONST char \* const \* numfnames;**\
 **NCURSES\_CONST char \* const \* numnames;**

**NCURSES\_CONST char \* const \* strcodes;**\
 **NCURSES\_CONST char \* const \* strfnames;**\
 **NCURSES\_CONST char \* const \* strnames;**\

## DESCRIPTION

This page summarizes variables provided by the **curses** library's low-level terminfo interface. A more complete description is given in the **curs\_terminfo**(3X) manual page.

Depending on the configuration, these may be actual variables, or macros (see **curs\_threads**(3X)) which provide read-only access to *curses*'s state. In either case, applications should treat them as read-only to avoid confusing the library.

### Alternate Character Set Mapping

After initializing the curses or terminfo interfaces, the **acs\_map** array holds information used to translate cells with the **A\_ALTCHARSET** video attribute into line-drawing characters.

The encoding of the information in this array has changed periodically. Application developers need only know that it is used for the "ACS\_" constants in \<curses.h\>.

The comparable data for the wide-character library is a private variable.

### Current Terminal Data

After initializing the curses or terminfo interfaces, the **cur\_term** contains data describing the current terminal. This variable is also set as a side-effect of **set\_term**(3X) and **delscreen**(3X).

It is possible to save a value of **cur\_term** for subsequent use as a parameter to **set\_term**, for switching between screens. Alternatively, one can save the return value from **newterm** or **setupterm** to reuse in **set\_term**.

### Terminfo Names

The **@TIC@**(1) and **@INFOCMP@**(1) programs use lookup tables for the long and short names of terminfo capabilities, as well as the corresponding names for termcap capabilities. These are available to other applications, although the hash-tables used by the terminfo and termcap functions are not available.

The long terminfo capability names use a "l" (ell) in their names: **boolfnames**, **numfnames**, and **strfnames**.

These are the short names for terminfo capabilities: **boolnames**, **numnames**, and **strnames**.

These are the corresponding names used for termcap descriptions: **boolcodes**, **numcodes**, and **strcodes**.

### Terminal Type

On initialization of the curses or terminfo interfaces, **setupterm** copies the terminal name to the array **ttytype**.

### Terminfo Names

In addition to the variables, **\<term.h\>** also defines a symbol for each terminfo capability *long name*. These are in terms of the symbol **CUR**, which is defined

```
#define CUR cur_term->type.
```

These symbols provide a faster method of accessing terminfo capabilities than using **tigetstr**(3X), etc.

## NOTES

The low-level terminfo interface is initialized using **setupterm**(3X). The upper-level curses interface uses the low-level terminfo interface, internally.

## PORTABILITY

X/Open Curses does not describe any of these except for **cur\_term**. (The inclusion of **cur\_term** appears to be an oversight, since other comparable low-level information is omitted by X/Open).

Other implementations may have comparable variables. Some implementations provide the variables in their libraries, but omit them from the header files.

All implementations which provide terminfo interfaces add definitions as described in the **Terminfo Names** section. Most, but not all, base the definition upon the **cur\_term** variable.

## SEE ALSO

**curses**(3X), **curs\_terminfo**(3X), **curs\_threads**(3X), [**terminfo**(5)](/terminfo/5.md).
