c4llv07e's personal site

I hate ncurses (as a concept)

Terminology

When I say "console apps" (Also known as CLI), I mean an applications that are using only stdin and stdout (and sometimes stderr) for an IO, don't confuse it to "terminal apps" (also known as TUI) that are using extended capabilities (terminfo) of the terminal to draw "psedo-graphics".

GUI is GUI, app that requires X11 or Wayland connections, using its own framebuffer and so on. You know it.

Introduction

I started using Linux 5 years ago, since then my opinion about terminals' drawing capabilities has changed a lot.

When you just started using Unix-like OS it looks like just a better way to create programs. Who needs alsactl if you have alsamixer? Do you really want to type ps aux | sort -bgk3 instead of just htop? And first I was thinking the same.

But then you want to make a script that kills the most CPU consuming program, or a script that slightly changes your volume. What will you use? The answer is obvious. You can't even pipe TUI's output.

  • So what? Yeah, TUI apps can't be redirected into stdin, it isn't a big secret. But is it a big deal?

No, but because of this it can't interact with stdout normaly. Which leads to..

TUI requires terminal

As I said before, TUI is operating not on a level of stdout, but on a level of terminal, it is requires to use it inside application with terminal capabilites, or, simply saying, it is requires to run inside a terminal.

  • Okay, yeah, I can't use my fancy neovim inside initramfs rescure mode, is it what you wanted to say?

Still no, but it also leads to..

Terminals requires graphics

Yes, maybe you can somehow write something that supports all terminfo features but prints output into stdout every frame. It would be the first "console based terminal". But I can't say if it is possible. And even after that you would still need to run a console somewhere.

Thus, because of that, most terminals are graphical applications that run a console inside them. This solves the issue, because now we have a working console in the graphical environment.

But then, for some reason, we decided to run a terminal application inside a graphical program. And that's where all problems began.

TUI is just a limited graphics output

My main problem with TUI is the concept that when we get fully graphical environment we don't use it as it is, but rather than we downgrade it down to 80x60 text-only output. And then we are trying to return that graphics with custom fonts, sixel, etc.

Why not just draw it on a regular window then?

Why I love consoles

You may already be thinking that I am that type of person who hates everything terminal related, wants as less text on the screen as posible, likes buttons and so on.

But that's not true. I still think that console apps are much better than GUI. I want to highlight world "console", because a lot of people confues it with terminal. If there would be a hirecraty of my love to the IO type, it would be something like this: Firstly I would prefer CLI, then - GUI, and only then TUI.

But what makes TUI so special?

TODO: finish this