Live data from Hacker News

Things I've learned building a modern TUI Framework (2022)

textualize.io

81–90 of 127 posts

Re: Things I've learned building a modern TUI Framework (2022)

#83

This TUI looks pretty, but I cannot imagine situation, when I would actually use it and be ready to pay for it. Probably I am not living in a right environment for it. But in my experience, either people are happy with something truly minimalistic or they try to please a user with GUI right away. For example, YouTube link in the article showed a possibility to display table with highlighting cells. Why would I need t…

One reason to prefer textual UIs is that you can use them from any computer anywhere fast (no slow video VNC). Also, if you are already using a terminal, then improving that experience is nice. There is a big enough market there for this company. However, I'm not sure what a "proper" GUI is. Terminals have a widely used open standard. These protocols are more standard and interoperable than any GUI framework, and the…

Or what if you just prefer to not use a browser to get your information on the internet. Textualize is like the only choice I can jump to.

It’s much better to hyperlink and open image and video in the browser from the terminal. In my opinion. Playing it would just block your terminal session, so it’s pretty annoying to have to open another tab with an inline video playing. I am happy with the features with textualize and haven’t even thought about needing things that play over a duration beyond a few seconds.

Textualize then becomes the browser api that I build my terminal browser and render only the components I care about.

None of that background or js libraries, ads. It’s well worth it.

Re: Things I've learned building a modern TUI Framework (2022)

#84

Why do software engineers care so much about TUI? I really don't get it. I love a good command line program. But TUI just doesn't appeal to me.

Because you may have no issue using browsers with extended batteries + features.

How about displaying data on cli w/ textualize vs on an admin web interface.

I find it much easier + direct to use some py-orm w/ textualize.

On an admin interface you’d have to worry about auth + some js ui framework that prints your custom html directives to tables… that eventually display text.

Re: Things I've learned building a modern TUI Framework (2022)

#85

> terminals are fast their slow as hell and incredibly inefficient to build graphics on top of > but many are powered by the same graphics technologies used in video games what does that mean? obviously they have to render text to graphics at some point > The first trick is "overwrite, don't clear". If you clear the "screen" and then add new content, you risk seeing a blank or partially blank frame for a brief moment…

They are slow!

Re: Things I've learned building a modern TUI Framework (2022)

#86
post #9

It's funny how every TUI developer eventually stumbles over Unicode and then handling international characters and emojis correctly turns into its own project close to the same scope of (or even bigger than) the original TUI project. It happened to me on rivo/tview and through the resulting rivo/uniseg package, I learned that all other TUI library maintainers deal with the same issues. Finally, everyone invents their…

The state of the art here is to detect mode 2027, and enable it when supported. This lets you know the terminal will handle graphemes properly. I maintain two TUI libraries which use this technique and emoji support has been (nearly) great. (One of which uses your uniseg library!) https://mitchellh.com/writing/grapheme-clusters-in-terminals

That isn't sufficient. Codepoints with ambiguous width can't be detected in a standard way. A large number of pre-emoji symbols have been upgraded to have emoji presentation. Some systems default them to emojis with wide rendering, others maintain the text presentation with narrow rendering. Many systems ignore the presentation selectors if you want to force it.

Re: Things I've learned building a modern TUI Framework (2022)

#87

This TUI looks pretty, but I cannot imagine situation, when I would actually use it and be ready to pay for it. Probably I am not living in a right environment for it. But in my experience, either people are happy with something truly minimalistic or they try to please a user with GUI right away. For example, YouTube link in the article showed a possibility to display table with highlighting cells. Why would I need t…

Proper GUI's are nice and all, until you need to do the same thing over an ssh connection.

Sometimes that works ok (ie forwarding X on a high bandwidth connection), but other times the proper GUI acts like a complete pig. :(

A text based GUI sounds like it might be the best of both worlds.

Re: Things I've learned building a modern TUI Framework (2022)

#88

This TUI looks pretty, but I cannot imagine situation, when I would actually use it and be ready to pay for it. Probably I am not living in a right environment for it. But in my experience, either people are happy with something truly minimalistic or they try to please a user with GUI right away. For example, YouTube link in the article showed a possibility to display table with highlighting cells. Why would I need t…

It does seems niche at this point. One scenario I can see is where you want something more user friendly than pure CLI and where providing a web UI might be too risky for some reason. A TUI could allow users to SSH in to server somewhere and just have TUI app as their shell. It's a bit contrived I grant you that. Personally I found Textual a little weird to use, but better than ncurses. Though it didn't really yield…

> Personally I found Textual a little weird to use, but better than ncurses.

Out of curiosity, have you looked at it's sibling project "rich"?

https://github.com/Textualize/rich

Seems like it provides a TUI toolkit as well, and it looks a bit less weird than the approach Textual uses.

Was thinking of trying it out with a side project recently, but got pulled onto some other stuff instead so haven't yet started. Nor made the choice between them. ;)

Re: Things I've learned building a modern TUI Framework (2022)

#89
post #62

Earlier quoted context omitted.

There were at least two other techniques back then. The first is to write to another buffer (possibly in normal RAM, not video RAM), then when the frame is done copy the whole buffer at once, so every pixel gets changed only once. The second is to write to another buffer that must be in video RAM too, then change the registers of the graphics hardware to use that buffer to generate pixels for the monitor to show. The…

> But the details of the register were possibly hardware-dependent, and there was no real graphics driver framework in place Did this change with 3dfx's Glide (or subsequently Direct3D once Windows got a foothold into the gaming industry)?

It's been a while, but as I recall, DirectX introduced a hardware abstraction layer from the get-go, but support was pretty spotty for the first few years. DirectX 7 was a pretty big step forward, and coincided with a lot of pretty important 3D features like hardware T&L and vertex buffer allocation. They got there before OpenGL, so the vendors mostly oriented around D3D7 and D3D8, but vendors' implementation was still pretty wonky and bespoke. Shaders hit for D3D9, and you had to pick between HLSL and GLSL, so the gap was widening then but I think the first time you can really describe a rigorous framework for graphics drivers, as opposed to a stack of shims of varying height, would be Windows 2000/XP bringing along XDDM (which then begat WDDM in Vista; WDDM has changed over the years, but is still recognizable in Windows 11).
Post reply on HN