hi, i'm trying to make a zsh-like shell for windows, but i'm having some trouble to do command parsing, pipe handling, etc on windows because every tutorial i found on the internet only works for linux, and i want to do the command parsing part first before the rest.
is there any way to do at least the command parsing part on windows? here's my code: https://pastebin.com/nSDkZ9D2
something i could do is to use the zsh source code as the base for my code, instead of trying to convert the code to windows.
well, technically i'm converting the code to windows, but you got the point.
The cygwin port won't help, it's probably just the Linux code compiled against the cygwin runtime. So the code won't need to be ported.
When all this port to Windows business started, GNU tools were rewritten for Windows and ran natively. There was the MKS Toolkit that did what Cygwin does, present a Unix layer for Windows. But that was a commercial product (money, licence, ...). Redhat worked on cygwin, and the rest is history. Most Unix apps now run on Windows under some kind of Unix emulation, like cygwin.
You're proposing writing a native zsh. It's a daunting task. You could start with your own Bourne Shell, and use the experience gained from that for your zsh. It's not a trivial task.
There's lots of stuff in a shell, much of which you're probably not aware of right now. I suggest you start with one feature at a time, starting with the ability to start a program. This way you'll become more knowledgeable about all shells.
You'll also learn about differences between fundamental things in both platforms that you'd not have considered before; like controlling terminals in Unix, and controlling consoles in Windows, differences in process creation and management, IPC, security, ...
It's not a waste of time, even if you don't finish it.
My best suggestion is to learn how to write a parser. YACC (or BISON if using GNU) is a great tool. Very useful in writing command parsers, languages and interpreters.
At the simplest level a parser takes input (text) tokens and converts them to "productions". A production is a combination of one or more tokens that represents an element of a command or language. Productions are combined and reduced until the entire input has been processed.