Friday | 08 DEC 2023

Porting NovaShell to D3 Properly

Once I had the naive version working, I knew it was possible to get nsh working under D3 relatively easily. I used ifdefs to conditionally compile things but unfortunately this is only available on D3 10.3 and later. Some of machines are running 10.2 and so I'll need to manually clean up nsh to run there.

This is the first time I wrote a program to target two different systems and the first time I used ifdefs. This was quite fun and its cool to see how I can tell the compiler to ignore certain blocks of code.

This does mean now I have some more cumbersome code as some things are duplicated. A little bit of code bloat to be able to use my shell on both D3 and UniVerse isn't too bad though.

The other big issue which I already ran into before is dealing with terminal types. vt100 works and its the one I've been programming for by one of our machines use wyse50 which required hardcoding some escape characters to get the arrows and tab to work. I'm curious why reading the infocmp data isn't enough. I have the escape characters but it seems that there is a different set in use than just those. Vim and other command line programs however deal with it perfectly fine which means there's probably a way to get it to work in nsh as well.

I'll need to poke around and see if I can learn something about the way to get terminal escape codes.

As of now, D3 and UniVerse work. Universe will work by default and D3 requires a compiling the program with a flag set. I'm pretty happy with the state of things right now.