@rl_dane

It basically redraws entire lines at a time, and a single character change invalidates the entire line that it is on.

#urwid #TUIs #SerialCommunications #Unix #ncurses

@rl_dane

Youth of today, with your emulators! (-:

I simply have an actual serial port that I can set to 1200 BPS, and log in on.

From a quick perusal of its 'raw' driver's code, you probably do not want to know #urwid's drawing behaviour.

#TUIs #SerialCommunications #Unix #ncurses

@rl_dane

It's not quite right, but you might like to experiment with instead of running that second reset running

stty cbreak; tput ti; kill -WINCH 0

These are just a bodge. The #urwid library and #sncli should be fixed.

#ncurses #termcap

@rl_dane

It would have to be more complex than that: a tool that sets cursor addressing mode and non-canonical input mode back up after nvi exits (which is when nvi tears down cursor addressing mode and all that stuff).

reset actually does the opposite of that.

Sadly, #ncurses, which #urwid can be layered on top of, is quite capable of switching between 'prog' and 'shell' modes; but this is simply not used by urwid and is not even the urwid underpinning that is chosen by #sncli anyway.

@rl_dane

#sncli relies on a Python library named #urwid that simply has no concept of temporarily restoring the canonical terminal mode whilst shelling out to external programs.

https://urwid.org

— Urwid 4.0.2

What are everybody's favourite simple #TUI libraries.

I've been looking at #npyscreen and #urwid or maybe #textual or #picotui ?

Basically, I want to design a #cyberdeck sort of thing, but I want the interface to be more like a Gameboy or an old fashioned purpose-built device.

#urwid is really nice for fast hacking neat terminal interfaces. gave it a go, much fun :) you won't feel cursed.
https://urwid.org
Overview — Urwid 2.1.2

#urwid does support overriding each LineBox character. So I should be able to plug in the existing config I wrote at least.
Unfortunately it also suffers from width miscalculations when the label contains more complex emoji, especially for ones that aren't rendered properly by the terminal... I guess that'll end up being an issue that will depend on upstream fixes.
All I could perhaps do is offer a way to specify padding/width offsets for certain glyphs or buttons, but that might only work for my own box implementation rather than LineBox.

That feeling when you find out that the function you've been #coding to add some functionality to a library, is actually already sort of implemented (and better?) in the library itself...

I guess I can simplify the box-drawing code for #TUILauncher as #urwid has urwid.LineBox().
(Though I might miss out on the custom box-drawing glyphs (unless that's also implemented already))

@kelbot maybe something to do with the way I calculate width, and/or the way #urwid handles multibyte characters.

Can you paste the characters you are using so I can test it myself tomorrow?