Couldn't seem to get #VimClassic to compile on #FreeBSD.

But then I realized the only thing I used it for is sncli, because it does something funny with the terminal when it hands it off to nvi, such that the cursor becomes invisible. But then, it's just a !reset to fix it, so I might as well just stick with nvi. ;)

#vi #vim #nvi #TextEditors #PlainText

@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

@JdeBP

Ah.

I tried to write a shell script that ran reset, then vi, then reset again. It helped vi, but sncli was totally unusable afterward.

!reset is good enough, I guess. ;)

@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

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

@JdeBP

Yeah, it sounds pretty dodgy (urwid).

One thing I like to do occasionally is run TUIs through trickle to see which ones are efficient, and which ones are redrawing everything tons of times for no good reason.

GitHub - sjmulder/trickle: 600 baud pipe and terminal.

600 baud pipe and terminal. Contribute to sjmulder/trickle development by creating an account on GitHub.

GitHub

@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

@JdeBP

Yeah, it's not much fun at 1200 baud. It's redrawing every single character onscreen, even the blank ones. But not when moving the selection bar, so at least there's that.

@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

scripts/resetvi at main

scripts - Some of my scripts that I wrote, which I use daily

Codeberg.org