On 09.05.2017 11:59, Roy Marples wrote: > On 05/05/2017 20:54, Kamil Rytarowski wrote: >> I have a pending task to write from scratch in C# for CoreFX (.NET >> platform assemblies) support for extracting registered entries from our >> native terminfo cdb file. (This is currently enforced to be this way, >> the same happens for ncurses) > > Interesting. > I'll assume that the goal is to behave 100% the same as NetBSD > libterminfo? So that means you need to actually compile the contents of > $TERMINFO and respect $TERMINFO_DIRS as well? > If I recall correctly the general goal is to pass $TERM and retrieve properties about it. https://github.com/dotnet/corefx/blob/f2a1529b8a73b9e6c7a194004af3806a108dacf7/src/System.Console/src/System/TermInfo.cs >> Adding another dimension with additional files and directories will make >> things more complicated for users of the database, that need to bypass >> the original tools and libraries. >> >> It's not that stops it, but gives some context about other potential users. > > Well, lets talk about making it easier then. > The basic requirement is that we need to allow $TERMINFO to be a > directory - this mirrors ncurses. What happens beyond this point is > entirely upto us. > > My current proposal is that underneath this the directories are created > following the terminals first character and a file inside which is the > terminal name followed by .bin. This tells us it's a flattened terminfo > blob and follow the same format as the blob for the equivalent terminfo > found in the system .cdb file. > > We could make this easier by dropping the nested directory (I don't > anticipate many terminfo files being added this way via tic, mainly from > pkgsrc). It could be made easier yet again by writing a .cdb file > instead so it behaves the same way - it will only contain a single > terminal description (well, it could technically hold >1 if there is >1 > in the imported terminfo source - thoughts anyone?)? > > Lastly, if the file extension doesn't have either .bin or .cdb then we > treat it as plain text terminfo (minus the use= tic exclusive > extension). This is trivial to support because unlike ncurses we need to > also allow $TERMINFO to hold an actual terminfo description - mainly > because we historically allowed $TERMCAP to old a termcap one. > > Another idea would be to make your life easier (and conversely mine > harder) would be to get each package to store it's terminfo description > and after installation, register them all using tic into one pkgsrc > compiled database. The downside of this is that each package would need > to install their terminfo file in a set location so that tic can use it > to rebuild (.cdb needs full source to build it, it's not piece-meal - as > such the first solution is less work for me), whereas the just currently > need to call tic to get it installed. Commentary on this welcome, > especially from packagers. > I don't have a preference, but I'm surprised that our single .cdb approach is going to be hybrid with support for ncurses layout. > Roy >
Attachment:
signature.asc
Description: OpenPGP digital signature