ion issueshttps://gitlab.redox-os.org/redox-os/ion/-/issues2020-12-12T22:46:30Zhttps://gitlab.redox-os.org/redox-os/ion/-/issues/918Plan for sourcing/translating sh scripts?2020-12-12T22:46:30ZSteven PeasePlan for sourcing/translating sh scripts?Once general concern that I have so far is that Ion introduces a lot of idiosyncratic behavior. It’s neither a Rust REPL with a subset of the language, but it also isn’t compatible with sh either. It’s kind of a mix of concepts of both. ...Once general concern that I have so far is that Ion introduces a lot of idiosyncratic behavior. It’s neither a Rust REPL with a subset of the language, but it also isn’t compatible with sh either. It’s kind of a mix of concepts of both. This introduces an additional barrier to learning and adoption.
One particular issue is that a lot of packages will install a shell script to set up environment variables etc. For instance, nix. There doesn’t seem to be any good way to source this file, and translating it currently would require rewriting it by hand (and potentially manually updating it if it changes).
A few thoughts I had:
1) An external translation application that can easily be used with a source directive
2) An sh-compatibility mode that can be invoked through use of a special sh directive
3) An sh-compatibility mode triggered by the shebang (this might still require annotating files, but be O(1) every time)
4) An extraction mode that actually forks an sh-compatible shell, then extracts default/new/specified environment variables at the end of that process back into the Ion environment
To keep the scope manageable, if it’s a pain to parse sh, you could probably get away with providing a subset of the most commonly used language features.unplannedhttps://gitlab.redox-os.org/redox-os/ion/-/issues/418prompt: Syntax Highlighting in Prompt2021-06-01T12:33:57ZMichael Aaron Murphymmstick@pm.meprompt: Syntax Highlighting in PromptWill require some seirous modifications to [liner](https://github.com/MovingtoMars/liner) in order to get this to work. I'm insure of the best approach for implementing this feature at the moment. Regex or a parsing crate may be ideal. S...Will require some seirous modifications to [liner](https://github.com/MovingtoMars/liner) in order to get this to work. I'm insure of the best approach for implementing this feature at the moment. Regex or a parsing crate may be ideal. Solution needs to focus on performance though. The following needs to occur:
- [ ] Color the command based on if the command exists or not
- [ ] Single quoted text should have a different color from double quoted text
- [ ] Operators should have their own unique colors
- [ ] Specific keywords should be highlighted, such as `end` and `if`
- [ ] Variables should also be highlighted
- [ ] Arrays should have a different color than variables
- [ ] Functions and aliases may also have different colors
- [ ] The coloring should be user-configurable and ideally match the grammar usage (in treesitter)Ion Shell v1.0.0Sag0Sag0Sag0Sag0