Live data from Hacker News

Writing Programs with Ncurses

invisible-island.net

71–80 of 93 posts

Re: Writing Programs with Ncurses

#71
post #4

I love TUIs. They are clear, quick and easy to use. Probably because they require straightforward design. I just read the following links to build up foundation of knowledge first - low-level: http://%CA%9E.cc/irl/term.html https://viewsourcecode.org/snaptoken/kilo/02.enteringRawMode... https://en.wikipedia.org/wiki/ANSI_escape_code#Colors Other libraries: # C, C++, Python and Rust https://github.com/dankamongmen/not…

For C++, there is also ImTui that I wrote sometime ago: https://github.com/ggerganov/imtui I made a few sample apps with it, such as HN client and a WTF configuration tool. They are both linked in the repo if you are interested. I still want to make some other cool terminal app with it, but haven't found a nice idea yet.

So, does that actually work in a proper terminal? Or is it only when you have a framebuffer available?

Re: Writing Programs with Ncurses

#72

I don't like text UIs. They try to emulate GUI but do it poorly. You should either make a classic console program, that can be scripted, piped, etc., or a real GUI.

> They try to emulate GUI but do it poorly

I dispute that point. Firstly, because TUIs and GUIs were developed pretty much in parallel, as far as I‘m aware. But secondly (and more importantly), because TUIs fill a different niche and follow a different philosophy to GUIs.

TUIs are primarily intended for environments where GUIs are either not available (e.g. SSH), unnecessary (e.g. servers), or overkill (e.g. very old computers). In terms of design and UX philosophy, they are much more concentrated on keybased rather than mousebased interaction, and bring their own set of conventions that are markedly different from GUI design philosophy.

So, while you are entitled not to like TUIs (they can be difficult to work with), calling them a bad emulation of GUIs really misses the point.

Re: Writing Programs with Ncurses

#73
post #15

Earlier quoted context omitted.

Similar experience (as a user) at a medium-sized college. The information system (class registration, bursar, etc) could be accessed via a TUI over telnet/ssh. It was amazingly fast, and all the older professors could move around that thing fast as hell, since all the shortcuts were in muscle memory. Force-adding a student to a class could literally take Students could use it, too. And those of us who knew about it w…

Hehe, we also had similar system in university. It was usually accessed over telnet, but in some places at the school, you could still find the real electron tube green (or orange?) text teletype terminal, where the student could sit and access just this system. It was fast in normal times, but you'd still have trouble using it when the class registrations opened, and thousands of students tried to use it at the same…

> It was fast in normal times, but you'd still have trouble using it when the class registrations opened, and thousands of students tried to use it at the same time.

Often the way these things work, the old terminals go slow (sometimes very slow) but work, and the new way times out often making it impossible to make changes, but sometimes you still can, but won't know if they worked.

Re: Writing Programs with Ncurses

#74
post #60

Earlier quoted context omitted.

Note that the project hasn't been contributed to since 2017, and contains unfixed bugs from six years ago. Might be worth a fork or a rewrite.

It's active. Seems to have been moved to https://github.com/v1cont/yad

I installed via AUR (which uses the right github link) and didn't notice that I was bookmarking the old version of the project. Thanks!

Re: Writing Programs with Ncurses

#79
post #57
post #5

Earlier quoted context omitted.

It would be nice if curses programs all had a standard keymapping or signal that would invoke one of curses screen dump functions. Lacking that, a screenreader would have to jump through a lot of hoops to even know what's on the screen. I suppose you could use tmux instead...it seems to be able to dump the current screen. Either way, still a lot of work to do after you have the raw data.

You don't need to dump the screen, the screen reader takes care of letting you explore the screen by line, word, character, etc. Some curses programs work reasonably well with screen readers (e.g. Mutt and WeeChat). One useful way to make them more accessible is to put the hardware cursor somewhere useful, even if hidden. Mutt puts it on the same line as the currently-selected message, and if braille_friendly is set,…

Can you give any more guidance on what might constitute "somewhere useful"?

Is the hardware cursor position the default place to start reading from?

Post reply on HN