That seems very much like what I am trying to achieve, but with guile instead. That's a cool way to use #lang. I have been writing a PEG parser to parse the command line using guile-PEG. I'll install your shell and play with it some.
Edit: My idea is to use the traditional Unix pipeline with forks and file descriptors. Does rash foreground processes like vim?
Rash only forks to launch processes, and it's all behind Racket's `subprocess` function. So there is no notion of eg. a forked subshell. But the `subprocess` function lets you get the subprocess file descriptors (as a special kind of port) or redirect subprocess IO to the ports of your choice. While pipeline segments that use Racket functions can pass each other arbitrary objects rather than just doing byte-level IO, pipeline segments that are just subprocesses do traditional Unix-style pipeline IO. And you can redirect a pipeline's input/output/error streams to arbitrary ports.
You can run pipelines in the background with Rash, but I haven't implemented job control yet, so I don't have proper handling for eg. auto-suspending a background TUI process and terminal control. (This ends up not being that big of a deal for most use, I find, though I intend to write better job control eventually.) I don't remember what Vim does off the top of my head, but I think running processes blocks Vim. Background pipelines don't block Rash, but if you don't specify to run one in the background the default behavior is to cause the current thread to wait for it to finish.
bjoli|7 years ago
Edit: My idea is to use the traditional Unix pipeline with forks and file descriptors. Does rash foreground processes like vim?
willghatch|7 years ago
You can run pipelines in the background with Rash, but I haven't implemented job control yet, so I don't have proper handling for eg. auto-suspending a background TUI process and terminal control. (This ends up not being that big of a deal for most use, I find, though I intend to write better job control eventually.) I don't remember what Vim does off the top of my head, but I think running processes blocks Vim. Background pipelines don't block Rash, but if you don't specify to run one in the background the default behavior is to cause the current thread to wait for it to finish.