However, I recall writing basically the same functionality as a QuickBasic library back in the DOS days. It's funny how things go full circle.
* https://github.com/jdebp/terminal-tests/blob/master/PowerShe...
https://www.qbasic.net/
https://www.qb64.org/