# Ncurses does not work

**URL:** https://discourse.julialang.org/t/ncurses-does-not-work/88373
**Category:** General Usage
**Created:** [October 6, 2022, 10:23pm UTC](https://discourse.julialang.org/t/ncurses-does-not-work/88373 "2022-10-06T22:23:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![whatsthecraic](https://avatars.discourse-cdn.com/v4/letter/w/7bcc69/32.png) [@whatsthecraic](https://discourse.julialang.org/u/whatsthecraic)
#### Post date: [October 6, 2022, 10:23pm UTC](https://discourse.julialang.org/t/ncurses-does-not-work/88373/1 "2022-10-06T22:23:09Z")

</div>

Dear community,

any idea how I should set up [ncurses](https://github.com/JuliaBinaryWrappers/Ncurses_jll.jl)?

```julia
# test-curses.jl
using Ncurses_jll
ccall(("initscr", libncurses), Cvoid, ())
ccall(("getch", libncurses), Cint, ())
ccall(("endwin", libncurses), Cvoid, ())

```

output:

```julia
# julia --project=. -- test-curses.jl
Error opening terminal: xterm-256color.

```

---

<div class="post-metadata">

### Author: ![devel-chm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/devel-chm/32/3572_2.png) [@devel-chm](https://discourse.julialang.org/u/devel-chm)
#### Post date: [October 6, 2022, 10:50pm UTC](https://discourse.julialang.org/t/ncurses-does-not-work/88373/2 "2022-10-06T22:50:46Z")

</div>

If you haven’t used curses/ncurses before, I suggest  
finding some ncurses C tutorial code on-line and get  
that working first as a test case.

A search for your error message suggests that ncurses  
is giving you a valid error so the ncurses binary could  
be working just fine and the difficulty is not specific to  
Julia.

---

<div class="post-metadata">

### Author: ![Ralph\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralph_smith/32/10344_2.png) [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)
#### Post date: [October 7, 2022, 3:21am UTC](https://discourse.julialang.org/t/ncurses-does-not-work/88373/3 "2022-10-07T03:21:07Z")

</div>

> [@whatsthecraic](#):
>
> `Error opening terminal: xterm-256color.`

This indicates that the library cannot find the terminal by this name in a `terminfo` database. The recommended fix/hack is described in [this issue](https://github.com/JuliaPackaging/Yggdrasil/issues/455).

As built, the library looks for the database first in `${TERMINFO}`, then `${HOME}/.terminfo`, and then in `/workspace/destdir/share/terminfo`. It should look in the `share/terminfo` folder of the artifact tree (good luck fixing that with autotools), so the hack is to set the envar accordingly.

---

<div class="post-metadata">

### Author: ![whatsthecraic](https://avatars.discourse-cdn.com/v4/letter/w/7bcc69/32.png) [@whatsthecraic](https://discourse.julialang.org/u/whatsthecraic)
#### Post date: [October 7, 2022, 3:00pm UTC](https://discourse.julialang.org/t/ncurses-does-not-work/88373/4 "2022-10-07T15:00:22Z")

</div>

I forgot to mention that this snippet already works in C within the same console.
