# Approaching first usable release of TextUserInterfaces.jl

**URL:** <https://discourse.julialang.org/t/approaching-first-usable-release-of-textuserinterfaces-jl/50971>\
**Category:** Package Announcements\
**Created:** [November 30, 2020, 1:45am UTC](https://discourse.julialang.org/t/approaching-first-usable-release-of-textuserinterfaces-jl/50971 "2020-11-30T01:45:38Z")\
**Posts on this page:** 9\
**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:** [November 30, 2020, 1:45am UTC](https://discourse.julialang.org/t/approaching-first-usable-release-of-textuserinterfaces-jl/50971/1 "2020-11-30T01:45:38Z")

</div>

Hi!

After a long time developing [TextUserInterfaces.jl](https://github.com/ronisbr/TextUserInterfaces.jl), I finally could implement the last feature I wanted before starting the code cleaning and documentation process: Dialogs!

If everything goes right, we are just about to reach the first usable (not stable) version!

 ![Captura de Tela 2020-11-29 às 22.39.27](https://global.discourse-cdn.com/julialang/original/3X/0/8/0899a9b1c5c5c27ed598877f1b65072840b27b8c.jpeg)

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [November 30, 2020, 3:42am UTC](https://discourse.julialang.org/t/approaching-first-usable-release-of-textuserinterfaces-jl/50971/2 "2020-11-30T03:42:03Z")

</div>

sweet

---

<div class="post-metadata">

**Author:** ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)\
**Post date:** [November 30, 2020, 3:46am UTC](https://discourse.julialang.org/t/approaching-first-usable-release-of-textuserinterfaces-jl/50971/3 "2020-11-30T03:46:13Z")

</div>

How does the plot support work? I have mainly switched over to `Gnuplot.jl` so I wonder if it can display those plots as well.

---

<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:** [November 30, 2020, 3:49am UTC](https://discourse.julialang.org/t/approaching-first-usable-release-of-textuserinterfaces-jl/50971/4 "2020-11-30T03:49:53Z")

</div>

The plot is generated by UnicodePlots.jl. I created a way to convert ANSI escaping color codes to Ncurses.

Gnuplot will not work because it is graphical (I think). Everything you are seeing is NCurses in a terminal. My idea is to create a Julia modern API to create TUIs instead of using the low level NCurses functions. Hence, we have definition of windows, widgets, container, focus, etc.

---

<div class="post-metadata">

**Author:** ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)\
**Post date:** [November 30, 2020, 4:06am UTC](https://discourse.julialang.org/t/approaching-first-usable-release-of-textuserinterfaces-jl/50971/5 "2020-11-30T04:06:40Z")

</div>

Oh I see. I was thinking maybe there was support to show Bitmaps or something like that but then you’d need some sort of GUI/graphics library. Support for `UnicodePlots` is great though.

---

<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:** [November 30, 2020, 2:37pm UTC](https://discourse.julialang.org/t/approaching-first-usable-release-of-textuserinterfaces-jl/50971/6 "2020-11-30T14:37:42Z")

</div>

Gnuplot has a sixelgd output option. Maybe that is compatible with TextUserInterfaces.jl?

---

<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:** [November 30, 2020, 4:18pm UTC](https://discourse.julialang.org/t/approaching-first-usable-release-of-textuserinterfaces-jl/50971/7 "2020-11-30T16:18:38Z")

</div>

No, it is not, but now I really want it to be 😃

I saw that maybe it is possible to make sixel play nice with NCurses. We only need to make sure that NCurses do not touch the area draw by sixel. It should be doable here. If anyone has anything that can help me, I am all ears!

---

<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:** [December 1, 2020, 8:01pm UTC](https://discourse.julialang.org/t/approaching-first-usable-release-of-textuserinterfaces-jl/50971/8 "2020-12-01T20:01:10Z")

</div>

I investigated sixel output from the gnuplot program and Gnuplot.jl from julia 1.5.3 using the mintty terminal program from cygwin. As cygwin is not a supported OS for julia, I needed to see how I could best work with julia on windows with cygwin.

I was not able to get gnuplot sixelgd output to display in mintty. As far as I can tell, the julia repl is not passing the needed control sequences through the standard output to get the sixel image to show. I did determine that if I save the figure output and then cat at the bash prompt on xterm or mintty that the sixel image is shown.

I did find a module supporting sixel graphics in terminal output, [TerminalGraphics.jl](https://github.com/m-j-w/TerminalGraphics.jl) but it is not in the registry. However it uses [libsixel](https://saitoha.github.io/libsixel/) which appears to give simple sixel IO support.  
[ImageMagick.jl](https://juliahub.com/docs/ImageMagick/0LbNX/1.1.6/) also supports sixel data with considerably more file formats supported. It appears that TerminalGraphics.jl also may have a work around for the REPL gobbling up the terminal escape sequences. I have not been able to test.

Here are the collected links to sixel graphics that were informative:

- [VT-3xx Graphics](https://vt100.net/docs/vt3xx-gp/chapter14.html)
- [Libsixel web page](https://saitoha.github.io/libsixel/)
- [SixelGraphics.jl (julia implementation of sixel IO)](https://github.com/olofsen/SixelGraphics.jl)
- [TerminalGraphics.jl](https://github.com/m-j-w/TerminalGraphics.jl)

It was _very_ nice to be able to view inline images and plots in a REPL/terminal session!

---

<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:** [December 1, 2020, 9:47pm UTC](https://discourse.julialang.org/t/approaching-first-usable-release-of-textuserinterfaces-jl/50971/9 "2020-12-01T21:47:16Z")

</div>

Thanks @devel-chm! I could output a sixel image here using the same approach of TerminalGraphics.jl.

However we have a huge problem. NCurses does not play fine with custom ANSI escape sequences. After initializing NCurses and defining a window, I was not able to write the image to stdout.

There is very little information on the internet about how can we make NCurses works with sixel. I am afraid it will require some very bad hacks.
