# Is there a package to construct TUI in Julia?

**URL:** <https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801>\
**Category:** General Usage\
**Created:** [January 19, 2019, 1:01am UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801 "2019-01-19T01:01:47Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [January 19, 2019, 1:01am UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/1 "2019-01-19T01:01:47Z")

</div>

Hi guys!

Is there any package to build text user interfaces in Julia?

I saw some NCurses wrappers but all old and does not seem to work anymore.

The good side of a TUI is that, just like UnicodePlots, it should work 100% of time even through ssh.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [January 19, 2019, 1:03am UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/2 "2019-01-19T01:03:38Z")

</div>

> **[GitHub - nick-paul/TerminalMenus.jl: Simple interactive menus for the...](https://github.com/nick-paul/TerminalMenus.jl)**
>
> Simple interactive menus for the terminal (Now ships with Julia!) - GitHub - nick-paul/TerminalMenus.jl: Simple interactive menus for the terminal (Now ships with Julia!)

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [January 19, 2019, 1:04am UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/3 "2019-01-19T01:04:59Z")

</div>

I saw that, but I want something complete like ncurses. So that we can have “full applications” in text mode. Something like midnight commander interface for example.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [January 19, 2019, 1:20am UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/4 "2019-01-19T01:20:04Z")

</div>

One possibility is to create a Julia package which writes shell scripts such as this one

[http://xmodulo.com/create-dialog-boxes-interactive-shell-script.html](http://xmodulo.com/create-dialog-boxes-interactive-shell-script.html)

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [January 19, 2019, 1:29am UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/5 "2019-01-19T01:29:17Z")

</div>

Yeah that is a possibility…

However, wouldn’t it be nice to have a way to build simple TUIs natively? I will do some tests, maybe I can make a proof of concept.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 19, 2019, 7:47am UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/6 "2019-01-19T07:47:35Z")

</div>

> [@Ronis\_BR](#):
>
> wouldn’t it be nice to have a way to build simple TUIs natively?

Of course it would be nice — someone just has to put in the work.

That said, supporting various terminals correctly is a nightmare — some are compliant, some aren’t, and a lot of workarounds are necessary. `ncurses` embodies a lot of accumulated knowledge about this, which a native library would have to replicate.

These days for anything more complicated than what is supported by TerminalMenus.jl I would simply go with a browser-based interface — much less work, and much more portable.

---

<div class="post-metadata">

**Author:** ![CDLuminate](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cdluminate/32/6787_2.png) [@CDLuminate](https://discourse.julialang.org/u/CDLuminate)\
**Post date:** [January 19, 2019, 7:59am UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/7 "2019-01-19T07:59:14Z")

</div>

Have a look at termbox: [https://github.com/jgoldfar/Termbox.jl](https://github.com/jgoldfar/Termbox.jl)  
It features a simpler API compared to ncurses.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [January 19, 2019, 12:53pm UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/8 "2019-01-19T12:53:53Z")

</div>

I see. So I will try to code yet another Ncurses wrapper that works on 1.0. All the others seem dead unfortunately

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 19, 2019, 12:59pm UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/9 "2019-01-19T12:59:35Z")

</div>

> [@Ronis\_BR](#):
>
> All the others seem dead unfortunately

I think what I said above may be a reason for this.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [January 19, 2019, 1:05pm UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/10 "2019-01-19T13:05:15Z")

</div>

but a wrapper to `libncurses` wouldn’t be much simpler? do you see any major problems of maintaining something like this?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 19, 2019, 1:24pm UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/11 "2019-01-19T13:24:18Z")

</div>

Depends on your budget for time and effort. A simple wrapper should not be too difficult, but a layer that interfaces more idiomatically with Julia could be more of a time investment. I don’t want to talk you out of it if you want to do this, just wanted to point out that the payoff/effort ratio may not make it the best choice for an UI.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [January 19, 2019, 1:27pm UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/12 "2019-01-19T13:27:38Z")

</div>

My use case seems very specific. I need to access workstations at my institute using ssh, and having a TUI to see and configure things for simulations would be very nice.

---

<div class="post-metadata">

**Author:** ![DennisK](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@DennisK](https://discourse.julialang.org/u/DennisK)\
**Post date:** [June 10, 2020, 10:51am UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/13 "2020-06-10T10:51:42Z")

</div>

Hi. There there any progress for a TUI package for Julia? It would be good if we can have something so that we can code real program without having to rely on a web framework. I personally like old-screen TUI programs.

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [June 10, 2020, 2:12pm UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/14 "2020-06-10T14:12:44Z")

</div>

Welcome to the community!

I noticed: [GitHub - ronisbr/TextUserInterfaces.jl: Text user interfaces for Julia](https://github.com/ronisbr/TextUserInterfaces.jl)

in the thread here: [Help to reduce very long compilation time](https://discourse.julialang.org/t/help-to-reduce-very-long-compilation-time/34052)

There’s also [The Julia REPL · The Julia Language](https://docs.julialang.org/en/v1/stdlib/REPL/#TerminalMenus-1)  
and it was updated yesterday (so only on Julia 1.6 master/nightly). I’m no expert on this, what’s the state-of-the-art (library) in TUIs (for any language)? I believe on Linux ncurses is (almost) always used (and for the library above, so doesn’t work on Windows, except I guess in WSL; but is tested on macOS), while Julia, end thus the merged package works on all platforms. See other threads here, look for “TUI”, but also consider looking for “GUI”. I’m just not sure TUI is a very hot topic for any language.

> <https://github.com/JuliaLang/julia/commit/36270e90eda7a8507f0c144a983af343cde73f4b>
>
> This overhaul of the \`AbstractMenu\` extension interface of \`REPL.TerminalMenus\` …addresses several concerns:
> 
> \- Printing the "paging" navigation indicators was handled by TerminalMenus, but the subtype methods were expected to print the cursor indicator and, for multiple-selection menus, the selection status indicators in a manner that preserved alignment. There was no obvious reason for the inconsistency.
> \- Printing these indicators relied on accessing a mutable private global variable in TerminalMenus. It was therefore not possible to use different settings simultaneously for two different menus (e.g. a main menu and its submenus).
> \- The API required that subtype methods supply a list of strings for each menu-option when really it only needed to know how many options were available. This was particularly problematic for large, dynamic menus whose options might change and for which lists of options would have to be reallocated regularly but were then thrown away after checking their length.
> 
> This deprecates the old interface in a backward-compatible manner, so is non-breaking.

> [@Standard library or original for TerminalMenus](https://discourse.julialang.org/t/standard-library-or-original-for-terminalmenus/23160):
>
> I want to use TerminalMenus in some minimal GUI app I’m developing. I can either use the [original author’s version](https://github.com/nick-paul/TerminalMenus.jl), or the one included in Julia’s standard libraries (documented [here](https://docs.julialang.org/en/v1/stdlib/REPL/#TerminalMenus-1)). I think they’re both really similar, it seems like the original one is slightly outdated (found an issue and [PRed](https://github.com/nick-paul/TerminalMenus.jl/pull/24) a fix for it), but I just don’t know what the best practice is in this case. If the standard library version should be used instead then we should add some depreciation-indication to the original one…

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [June 10, 2020, 11:38pm UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801/15 "2020-06-10T23:38:05Z")

</div>

Yes, as @Palli said, I have been developing [TextUserInterface.jl](https://github.com/ronisbr/TextUserInterfaces.jl). It uses NCurses and my goal is to achieve a Julia-like API to build TUIs. However, it turns out to be a quite complicated thing to do 🙂 So the development is progressing more slow than I expected.

If you want to only uses baremetal NCurses, then TextUserInterfaces.jl is fine. Just download the `master` branch. The documentation is also missing, so you will have to look at source code for now.

However, I am pretty excited with the API. I have now things like widgets, anchors, auto-resizing, containers, windows, etc. It is being very simple to create and manage somewhat complex TUIs as I show here:

> [@TextUserInterfaces.jl: The road so far](https://discourse.julialang.org/t/textuserinterfaces-jl-the-road-so-far/34098):
>
> Hi! As some of you know, I am (trying) to develop an interface between Julia and NCurses in the package [TextUserInterfaces.jl](https://github.com/ronisbr/TextUserInterfaces.jl). Today, I think I hit a major milestone! I have rewritten everything so that we can work with widgets more or less like we do in Qt and GTK. It is now somewhat more easy to develop things like labels, inputs, progress bars, push buttons, radio buttons, etc. I also created a new positioning system, based on anchors. Thus, you can add widgets with position and size based …
