ion issueshttps://gitlab.redox-os.org/redox-os/ion/-/issues2020-11-06T02:13:00Zhttps://gitlab.redox-os.org/redox-os/ion/-/issues/950have kill funtion like bash/zsh, regarding autocompleate2020-11-06T02:13:00Zunmellowhave kill funtion like bash/zsh, regarding autocompleatewhen i type kill into bash or zsh and then press tab i'll get a list
of all the runing processes
EG: ![Screenshot_from_2020-04-03_14-53-56](/uploads/566655c2c0048bfd8712e3e7a35ff05b/Screenshot_from_2020-04-03_14-53-56.png)
i can search ...when i type kill into bash or zsh and then press tab i'll get a list
of all the runing processes
EG: ![Screenshot_from_2020-04-03_14-53-56](/uploads/566655c2c0048bfd8712e3e7a35ff05b/Screenshot_from_2020-04-03_14-53-56.png)
i can search for a process by name select it by pressing tab then i hit enter once
to get kill with all the selected pid's next to it and i can just hit enter again
to kill all those processes right now when i want to kill a program i just start zsh
and do it that wayhttps://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/847Switch to Rust 2018 syntax2019-02-19T21:58:17ZAdminXVIISwitch to Rust 2018 syntaxRust 2018 has a lot of new syntax items that make the code easier to read. This would be a massive improvement over 1.29, like [Non-Lexical Lifetimes](https://rust-lang-nursery.github.io/edition-guide/rust-2018/rust-2018/ownership-and-li...Rust 2018 has a lot of new syntax items that make the code easier to read. This would be a massive improvement over 1.29, like [Non-Lexical Lifetimes](https://rust-lang-nursery.github.io/edition-guide/rust-2018/rust-2018/ownership-and-lifetimes/non-lexical-lifetimes.html) and module improvement, like dropping `extern crate`.
1.29.0 is also 5 month old, and some features start to become slowly deprecated, meaning the longer Ion wait, the more it will have to catch up.
Since cargo offers `cargo fix`, it should not be tedious work.https://gitlab.redox-os.org/redox-os/ion/-/issues/830watch command for shell2019-02-13T23:52:14ZRithwik kukunuriwatch command for shellThere is no watch command in ION and I would like to work on it. Can you also tell where I can find the code for the shell commands?There is no watch command in ION and I would like to work on it. Can you also tell where I can find the code for the shell commands?https://gitlab.redox-os.org/redox-os/ion/-/issues/818cargo install ion2020-12-12T23:18:13ZSquirrelcargo install ionWould be lovely if cargo install ion worked just like cargo install bat or cargo install ripgrep works.
Then I could just type ion and run the shell.
(Liking your work, trying to use it as main shell)Would be lovely if cargo install ion worked just like cargo install bat or cargo install ripgrep works.
Then I could just type ion and run the shell.
(Liking your work, trying to use it as main shell)Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/569Perform Builtin Lookup When Parsing2018-06-12T14:22:02ZMichael Aaron Murphymmstick@pm.mePerform Builtin Lookup When ParsingJobs should make note if they are a builtin or not during parsing, rather than execution. This would lead to some possibly-big improvements for loops. With the static builtin map, functions will always have the same index position, so th...Jobs should make note if they are a builtin or not during parsing, rather than execution. This would lead to some possibly-big improvements for loops. With the static builtin map, functions will always have the same index position, so the `Job` structure could be extended to contain a static reference to it's builtin function.https://gitlab.redox-os.org/redox-os/ion/-/issues/470Multi-Dimensional Arrays?2021-06-01T11:22:46ZMichael Aaron Murphymmstick@pm.meMulti-Dimensional Arrays?Current proposed syntax, which should take advantage of the typed assignments feature.
```ion
$ let md_array:[[str]] = [[one two three][four five six][seven eight nine]]
$ echo md_array[0]
> one two three
$ echo mod_array[0][0]
> one
``...Current proposed syntax, which should take advantage of the typed assignments feature.
```ion
$ let md_array:[[str]] = [[one two three][four five six][seven eight nine]]
$ echo md_array[0]
> one two three
$ echo mod_array[0][0]
> one
```
# Roadmap
1) [ ] Merge `Key` and `Primitive` types as a `Key` enum
2) [ ] Make a new enum which holds data (and possible recursive inner types) for each `Key` enum variant
3) [ ] Fix `shell::assignment` and other important modules to reflect changes
[Roadmap due to evolve as time progresses]Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/439Possible Algebraic Data Types / Enum Support?2021-06-01T11:58:08ZMichael Aaron Murphymmstick@pm.mePossible Algebraic Data Types / Enum Support?Another feature that would give Ion an advantage is to support algebraic data types / enums. We just need to figure out a syntax that would make sense for a shell language. Here's an example of how it might look like.
```sh
# Create an ...Another feature that would give Ion an advantage is to support algebraic data types / enums. We just need to figure out a syntax that would make sense for a shell language. Here's an example of how it might look like.
```sh
# Create an enum pattern
enum Action = Withdraw(amount:int) Deposit(amount:int)
while true
echo -n "Enter the action to perform"; read input
match input
case 1
echo -n "Enter amount to withdraw: "; read amount
# Assign a variable that is an enum
let action:enum = Action:Withdraw($(ftoi $amount -d 2))
break
case 2
echo -n "Enter amount to deposit: "; read amount
# Assign a variable that is an enum
let action:enum = Action:Deposit($(ftoi $amount -d 2))
break
case 3; echo "Exiting"; exit
case _; echo "Invalid Input"
end
end
# Match on a pattern that represents an enum
# Requires that all variants are handled
match action:enum
case Withdraw(amount)
echo "Withdrawing $amount"
case Deposit(amount)
echo "Withdrawing $amount"
end
```
No reason to not go the extra mile in creating a next-gen *nix shell.unplannedhttps://gitlab.redox-os.org/redox-os/ion/-/issues/419Fix `echo hello#world`2018-06-12T14:22:03ZMichael Aaron Murphymmstick@pm.meFix `echo hello#world`The output used to be `hello#world`, but it seems the parsing has changed so that the `#world` is cut off. This is more than likely related to the `StatementSplitter`. We should implement tests to ensure that it doesn't happen again in t...The output used to be `hello#world`, but it seems the parsing has changed so that the `#world` is cut off. This is more than likely related to the `StatementSplitter`. We should implement tests to ensure that it doesn't happen again in the future.https://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.0Sag0Sag0Sag0Sag0https://gitlab.redox-os.org/redox-os/ion/-/issues/417Remove Indentation When `end` Is Detected2018-06-12T14:22:03ZMichael Aaron Murphymmstick@pm.meRemove Indentation When `end` Is DetectedMay require some work on [liner](https://github.com/MovingtoMars/liner) to implement. See https://github.com/MovingtoMars/liner/issues/39May require some work on [liner](https://github.com/MovingtoMars/liner) to implement. See https://github.com/MovingtoMars/liner/issues/39https://gitlab.redox-os.org/redox-os/ion/-/issues/414Make End Keyword In Case Statements Optional2018-06-12T14:22:03ZMichael Aaron Murphymmstick@pm.meMake End Keyword In Case Statements OptionalThis is what Fish does, as the `case` keyword already denotes that a new case block is being specified, so I'm not sure I see the value in requiring the end keyword to end a case.This is what Fish does, as the `case` keyword already denotes that a new case block is being specified, so I'm not sure I see the value in requiring the end keyword to end a case.https://gitlab.redox-os.org/redox-os/ion/-/issues/411Ion as a Library2019-07-17T02:14:30ZMichael Aaron Murphymmstick@pm.meIon as a LibraryI'd like to be able to integrate Ion directly into my Parallel project, which needs to execute commands within a shell for each element processed (and an ability to even provide scripts as input elements), but that will require some work...I'd like to be able to integrate Ion directly into my Parallel project, which needs to execute commands within a shell for each element processed (and an ability to even provide scripts as input elements), but that will require some work to get Ion suitable for use as a library, and separating the Binary logic from the Library logic. Namely, have a set of public library functions that would enable one to create a `Shell` structure that writes to a different stderr and stdin FD, then returns something like `IonResult(exit_status: Status, stdout: String, stderr: String)` when the shell returns.
Main reasoning for doing this versus executing ion as an external command is that this has a very high runtime cost for a program like Parallel, which tends to execute dozens, hundreds, or even thousands of inputs in parallel. Basically, ensuring that Parallel is the fastest implementation of GNU Parallel, under a permissive license.https://gitlab.redox-os.org/redox-os/ion/-/issues/392Emptiness Method Check2018-06-12T14:22:03ZMichael Aaron Murphymmstick@pm.meEmptiness Method CheckIt might be useful to have a check to indicate emptiness of a variable. If the result of this method is true, return "1", else return nothing. Or should we return "0" as well if false? The benefit of not returning a value for a false ver...It might be useful to have a check to indicate emptiness of a variable. If the result of this method is true, return "1", else return nothing. Or should we return "0" as well if false? The benefit of not returning a value for a false verdict is that the `test` command defaults to `-n` when no flags are specified, which makes the following possible:
```ion
if test $is_empty(string)
echo true
else
echo false;
end
```
```ion
if test @is_empty(array)
echo true
else
echo false;
end
```https://gitlab.redox-os.org/redox-os/ion/-/issues/391Unwrap Or Methods2018-06-12T14:22:03ZMichael Aaron Murphymmstick@pm.meUnwrap Or MethodsThis is another set of methods that are trivial to implement. If the given variable does not exist, then use the specified default value. Only question is, should we also consider empty variables as not existing?
- $unwrap_or(string, ...This is another set of methods that are trivial to implement. If the given variable does not exist, then use the specified default value. Only question is, should we also consider empty variables as not existing?
- $unwrap_or(string, "default value")
- @unwrap_or(array, [default, array])https://gitlab.redox-os.org/redox-os/ion/-/issues/390Path String Methods2018-06-12T14:22:03ZMichael Aaron Murphymmstick@pm.mePath String MethodsPathname handling is a common activity in shell code, so we should promote them as first class methods. Rust will make this very easy to implement.
- $extension(filepath)
- $basename(filepath)
- $parent(filepath)
- $filename(filepath)Pathname handling is a common activity in shell code, so we should promote them as first class methods. Rust will make this very easy to implement.
- $extension(filepath)
- $basename(filepath)
- $parent(filepath)
- $filename(filepath)https://gitlab.redox-os.org/redox-os/ion/-/issues/330Polish Notation2020-04-22T02:45:36ZMichael Aaron Murphymmstick@pm.mePolish NotationIt might be interesting to support prefix notation in the same way that [Elvish](https://elvish.io/) does.
```ion
$ + 1 2
3
$ * (+ 2 4) 5
30
$ * + 2 4 5
30
$ < 1 3
(returns 0 exit status)
$ > 1 3
(returns 1 exit status)
```It might be interesting to support prefix notation in the same way that [Elvish](https://elvish.io/) does.
```ion
$ + 1 2
3
$ * (+ 2 4) 5
30
$ * + 2 4 5
30
$ < 1 3
(returns 0 exit status)
$ > 1 3
(returns 1 exit status)
```https://gitlab.redox-os.org/redox-os/ion/-/issues/276Publish src/shell_expand/ as crate2018-06-18T16:32:22ZMichael Aaron Murphymmstick@pm.mePublish src/shell_expand/ as crate*Created by: kpcyrd*
I'm very interested in processing a string for something that is suiteable for the permutate crate.
I've tried to reimplement the subset of features I need (expand_braces) and ended up with something buggy half-w...*Created by: kpcyrd*
I'm very interested in processing a string for something that is suiteable for the permutate crate.
I've tried to reimplement the subset of features I need (expand_braces) and ended up with something buggy half-working. Could you consider publishing the shell expander as a crate I can use in my program :) ?https://gitlab.redox-os.org/redox-os/ion/-/issues/248Builtin, Prompt Plugins2021-06-01T11:03:06ZMichael Aaron Murphymmstick@pm.meBuiltin, Prompt PluginsWe could have a directory for Ion at **~/.config/ion/**, and in this directory we can have a **plugins** directory. Within the **plugins** directory we could have a **prompts**, **builtins** directory that each would store dynamic Rust l...We could have a directory for Ion at **~/.config/ion/**, and in this directory we can have a **plugins** directory. Within the **plugins** directory we could have a **prompts**, **builtins** directory that each would store dynamic Rust libraries.
## Prompt Plugins
We could have an extra variable, `PROMPT_PLUGIN`, that when set to a value, will attempt to execute a library of that name to get the prompt string.
I dont know if a plugin system is overkill for an ideally simple thing like a prompt. We dont want to emulate a code editor in the shell prompt.
## Builtin Plugins
When the shell is launched, libraries in the builtins directory could be scanned to import additional builtins into the shell as the `Shell` struct is created.
Builtin plugins could compromise Rusts stability features, so I kinda dislike not forcing the usage of our build system (and thus the Rust compiler to check things).unplannedhttps://gitlab.redox-os.org/redox-os/ion/-/issues/231Refactoring Plans2018-06-12T14:22:05ZMichael Aaron Murphymmstick@pm.meRefactoring PlansI think it'd be best if we separated builtins from existing modules and placed them into their own `builtins` module. No need to have them embedded within existing structures. Perhaps one file per builtin command.
In addition, the `Co...I think it'd be best if we separated builtins from existing modules and placed them into their own `builtins` module. No need to have them embedded within existing structures. Perhaps one file per builtin command.
In addition, the `Command` structure in the main source file should also go into the `builtin` module and perhaps have it's name changed from `Command` to `Builtin`, as these commands are built in. To do this, the `Shell` structure and all of it's methods would have to be separated into it's own `shell` module too.
Finally, it's probably best if the builtins are statically generated at compile time, instead of regenerating them each time a command is evaluated.
### Refactor Shell/Command Structures
- [x] Shell -> shell.rs
- [x] Command -> builtin/mod.rs
- [x] Split Flow Control Logic Into Flow Logic Module
### Builtins Refactoring Progress
- [x] alias
- [x] unalias
- [x] let
- [x] drop
- [x] export
- [ ] cd
- [ ] dirs
- [ ] pushd
- [ ] popd
- [ ] read
- [ ] exit
- [ ] history
- [x] source
- [ ] true
- [ ] false
- [ ] help