Pete's Log: shell?
Entry #636, (Coding, Hacking, & CS stuff)(posted when I was 22 years old.)
So I gave up last night at about 4 am. Here's been my process so far:
- Rewrite parser (an afternoon)
- Add glob matching to parser (another afternoon)
- Mess with tcsh a whole bunch to see what it does in certain situations (many hours)
- Keep detailed notes of everything tcsh does incorrectly
- Finally sit down and start adding job control to shell
Right now I'm up to about 2100 lines of code, of which more than 600 are my parser. So I'm pretty sure that I can say I've gone about this the wrong way. I'm really quite happy with my new parser, but chances are I wasted too much time on it. I spent too much time figuring out what tcsh does in rare occasions and not enough time worrying about the common case. I thought about all sorts of odd race conditions that could happen, and in the process failed to account for some of the more obvious ones. So now I have a shell with job control that is mostly functional. From time to time it'll kinda hang for a while, and there's an odd variety of error messages that get printed out from time to time. So I think this is the proper place to start over. At least now I know what needs to happen. And I can safely say I understand job control much better than I would if I'd simply started working on the common case. And I know a lot more about signal handling now as well.