poetaman / arttime

arttime is a CLI application that blends beauty of ASCII / text art with functionality of clock / timer / pattern-based time manager in terminal ⏰
Other
938 stars 15 forks source link

Scrolling on FreeBSD 13.1-RELEASE-p2 #16

Closed grahamperrin closed 2 years ago

grahamperrin commented 2 years ago

Spun off from https://old.reddit.com/r/freebsd/comments/xpyr0l/-/iq72rm0/?context=3

freebsd@freebsd:~/dev/arttime $ echo $TERM
xterm-256color
freebsd@freebsd:~/dev/arttime $ 

https://user-images.githubusercontent.com/192271/192857987-c29179b6-91d5-449d-9f37-fad9ee6253b5.mp4

poetaman commented 2 years ago

@grahamperrin Thanks! I got my hands on a FreeBSD 13.1 machine, I'll do the rest... The problem is with assumption that tput accepts both terminfo and termcap names, as can be seen with the documentation of tput that ships with ncurses below. In all the machines I had tested in past, it had ncurses's implementation of tput. Given that assumption is not true for FreeBSD systems prior to 14.0-CURRENT, arttime needs update.

       capname
              indicates the capability from the terminfo database.  When termcap support is compiled
              in, the termcap name for the capability is also accepted.
poetaman commented 2 years ago

@grahamperrin I pushed the fix in same branch oldbsdtput. Please pull and give it a try, it should work well now...

Note: If your termcap does not have capabilities defined, arttime will print errors at launch time with their terminfo names (keep an eye). In base FreeBSD13.0-RELEASE, I get legit errors that certain simple and important capabilities are not defined in default termcap database for xterm-256color/tmux-256color. All the TERMs seem limited compared to their terminfo equivalents. For instance the default terminfo of xterm-256color has capabilities (termcap equivalents in brackets): smcup (ti), rmcup (te), smam (SA), rmam (RA), but termcap database of xterm-256color in FreeBSD has none of those. Similar problem with tmux-256color, though it has smcup (ti), rmcup (te). Such discrepancy in the meaning of xterm-256color, and tmux-256color in default termcap/terminfo database makes it difficult to write portable code. Refer this page for mapping between terminfo and termcap: https://man7.org/linux/man-pages/man5/terminfo.5.html. Unlike terminfo database which I know how to compile and save, I have no clue how to generate a new termcap database .db file after hand-editing these arcane termcap entries for xterm-256color and tmux-256color on FreeBSD13.0-RELEASE.

grahamperrin commented 2 years ago

… Please pull and give it a try, it should work well now …

Confirmed, working. Thanks!

poetaman commented 2 years ago

@grahamperrin Closing this as scrolling issue is fixed, let's carry forward the discussion about https://github.com/reportaman/arttime/issues/16#issuecomment-1263280574 in the other ticket you filed https://github.com/reportaman/arttime/issues/18. Its not an arttime bug, it might lead us to patching stale terminal databases being published... Though its very important path to pursue if we want users to not hit such issues, and developers to not bypass term databases and hack around them by embedding escape sequences (like vim, etc) in their applications going forward.