Live data from Hacker News

Writing Programs with Ncurses

invisible-island.net

11–20 of 93 posts

Re: Writing Programs with Ncurses

#11
I have looked into this in the past, and have always felt discouraged by the lack of good support for modern keyboards and mice. With ncurses and similar, you can only detect (a subset of) keys modified by Ctrl and Alt; I would like a portable way of finding about multiple combinations of modifiers, with any key in the keyboard, including function keys, home, end, up, down, etc. Ideally, I would also like to detect mouse events (including "window" clicked position) and even mouse events when holding Ctrl, Alt, etc. And I would like to do all this without having to parse multiple escape codes, implement timers or whatnot.

https://sw.kovidgoyal.net/kitty/keyboard-protocol/ is a very promising step on this direction. Maybe next time I have to work on a TUI I will look into it.

Re: Writing Programs with Ncurses

#12
post #6
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…

True, i worked in a insurance company, the main CRM was a TUI with a Mainframe in the background, fast and reliable as hell/heaven. Then everyone (Management) wanted to go away from mainframe (because it's 60's technology and expensive), so we developed a Java application with a GUI and Oracle in the background..and i was just ashamed about the whole project when it was finished. It was slower for the user, less reli…

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 would do so, since it was so much better.

Then the web frontend came out…

Re: Writing Programs with Ncurses

#13
post #6
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…

True, i worked in a insurance company, the main CRM was a TUI with a Mainframe in the background, fast and reliable as hell/heaven. Then everyone (Management) wanted to go away from mainframe (because it's 60's technology and expensive), so we developed a Java application with a GUI and Oracle in the background..and i was just ashamed about the whole project when it was finished. It was slower for the user, less reli…

Wanted to hear this. This had been my experience too. But no one on the net seem to talk about it. It was always "we are stuck with mainframe due to politics..."

But this isn't about mainframe vs Java. I have a feeling it's about Terminal user interface vs GUI.

A modern terminal app, will be just as much fast as those old mainframe apps, is my feeling.

Re: Writing Programs with Ncurses

#14
post #6
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…

True, i worked in a insurance company, the main CRM was a TUI with a Mainframe in the background, fast and reliable as hell/heaven. Then everyone (Management) wanted to go away from mainframe (because it's 60's technology and expensive), so we developed a Java application with a GUI and Oracle in the background..and i was just ashamed about the whole project when it was finished. It was slower for the user, less reli…

I did such a migration. End results :

- user security massively increased (they need hardware tokens)

- user management is now part of a globalized management system where control access are much stricter than (let's call the dev to add somebody)

- it is muuuch easier to find new Java devs; development is now shared between the company (for business knowledge) and another company for the development, diminishing the train factor by a huge amount.

- code has been modernized and so is much more easy to audit

- SQL database can be queried by armies of cheap data analysis tools

- some of the consultants have now much less power to negotiate their salary (less than they were only 3 managing the application :-) )

That were for the positives. Negattives:

- Java UI needs much more time to get polished or much better dev's.

- Security is now much more administrative. Gone the days of the quick fix in production.

- hardware token for security is not vey well handled, incurring a heavy toll on data access (a limitation of our security token, which was unfortunately not seen during project planning)

- we had to reproduce all the TUI shortcuts for people to stay productive. Yes, you read that correctly :-)

Re: Writing Programs with Ncurses

#15
post #6

Earlier quoted context omitted.

True, i worked in a insurance company, the main CRM was a TUI with a Mainframe in the background, fast and reliable as hell/heaven. Then everyone (Management) wanted to go away from mainframe (because it's 60's technology and expensive), so we developed a Java application with a GUI and Oracle in the background..and i was just ashamed about the whole project when it was finished. It was slower for the user, less reli…

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 time.

Re: Writing Programs with Ncurses

#16
post #14
post #6

Earlier quoted context omitted.

True, i worked in a insurance company, the main CRM was a TUI with a Mainframe in the background, fast and reliable as hell/heaven. Then everyone (Management) wanted to go away from mainframe (because it's 60's technology and expensive), so we developed a Java application with a GUI and Oracle in the background..and i was just ashamed about the whole project when it was finished. It was slower for the user, less reli…

I did such a migration. End results : - user security massively increased (they need hardware tokens) - user management is now part of a globalized management system where control access are much stricter than (let's call the dev to add somebody) - it is muuuch easier to find new Java devs; development is now shared between the company (for business knowledge) and another company for the development, diminishing the…

It sounds you had a much bigger budget than we had ;)

BTW, the Mainframe had a sql-database (DB2) and was attached to Active-Directory already, the Reports/Print-jobs where send to a Linux Machine, it was actively maintained and not some old crusty 70's System.

Re: Writing Programs with Ncurses

#17
post #13
post #6

Earlier quoted context omitted.

True, i worked in a insurance company, the main CRM was a TUI with a Mainframe in the background, fast and reliable as hell/heaven. Then everyone (Management) wanted to go away from mainframe (because it's 60's technology and expensive), so we developed a Java application with a GUI and Oracle in the background..and i was just ashamed about the whole project when it was finished. It was slower for the user, less reli…

Wanted to hear this. This had been my experience too. But no one on the net seem to talk about it. It was always "we are stuck with mainframe due to politics..." But this isn't about mainframe vs Java. I have a feeling it's about Terminal user interface vs GUI. A modern terminal app, will be just as much fast as those old mainframe apps, is my feeling.

I don't think it is exactly TUI vs GUI, but more keyboard-first vs mouse-first, i.e. how you interact with it. Granted, Desktop GUI are usually developed mouse-first, but it doesn't have to be that way: if you take windows 98 / windows 2000, you could get everything done more efficiently with a keyboard than with a mouse.

Just think about the difference between an app developed specifically for the desktop (mouse) or for mobile (touch): same GUI but completely different programs and experience

Re: Writing Programs with Ncurses

#18
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.

Re: Writing Programs with Ncurses

#19
post #13
post #6

Earlier quoted context omitted.

True, i worked in a insurance company, the main CRM was a TUI with a Mainframe in the background, fast and reliable as hell/heaven. Then everyone (Management) wanted to go away from mainframe (because it's 60's technology and expensive), so we developed a Java application with a GUI and Oracle in the background..and i was just ashamed about the whole project when it was finished. It was slower for the user, less reli…

Wanted to hear this. This had been my experience too. But no one on the net seem to talk about it. It was always "we are stuck with mainframe due to politics..." But this isn't about mainframe vs Java. I have a feeling it's about Terminal user interface vs GUI. A modern terminal app, will be just as much fast as those old mainframe apps, is my feeling.

Mainframes do have a more sensible way to build a TUI than something like curses. A 3270 TUI is very similar to using html forms. The fields are named, have attributes, validation, and a so on. The mainframe sends the form, the user interacts with the form, and nothing is sent back to the server until either a field validation is needed or the "Enter" key is pressed.

More detail: http://bitsavers.trailing-edge.com/pdf/ibm/3270/GA23-0059-4_...

Re: Writing Programs with Ncurses

#20

While discussing ncurses, has anyone ever seen any attempt to make accessible interfaces? Nowadays when making a quick interface I tend to use a web-based interface -- while they are much heavier it's fairly easy to make fully blind accessible interfaces, I (very briefly) looked to see if any terminal based libraries supported anything similar, and the only thing which seems to be trying is emacs, with emacsspeak (wh…

[deleted]
Post reply on HN