ab5tract / Terminal-Print

Terminal::Print is a pure Raku layer for printing to terminal screens
Other
25 stars 18 forks source link

Fixed some bugs in terminal and capa querying. #43

Closed ramillies closed 7 years ago

ramillies commented 7 years ago

Done a few things, namely:

1) Changed the 'unit module' to a 'module { }' because the former triggers a compiler bug (if an exception is ever thrown and there is a CATCH in the module -- no matter what it does) 2) Added 'linux' to the terminal whitelist. (The terminals that you get after doing a Ctrl+Alt+Fx (0<x<7) are typically of this type.) 3) Whenever a 'smcup' or 'rmcup' capability is not found in the termcap database, we replace it with a 'clear' capability. 4) Whenever any other capability is not found in the database, we only store a '-1' in the appropriate hash. If the '-1' would ever have to be printed, we die. (This was supposed to use Failures, but these trigger only more compiler bugs.) This, in conjunction with 3), fixes bug #42. 5) Eliminated a potential bug which would, when the module would be used on a non-whitelisted terminal type, make the program fail with something like 'Type check in binding failed, expected Associative, got Any' instead of the nice die message.

Sadly I don't know how to make good tests for this (it generally needs messing with the TERM variable and having the correct termcap database records). I would be happy to remedy if anybody has an idea how to make them well.

ab5tract commented 7 years ago

Thanks!

ramillies commented 7 years ago

Please be sure to try it out at least on your box. It works on mine, but heck, I can't be really sure with all those compiler errors!

ab5tract commented 7 years ago

It works fine here. Until we engineer a proper test suite (or strategy, even) we'll unfortunately have to take an "optimistic" stance on reliability.