redox-os issueshttps://gitlab.redox-os.org/groups/redox-os/-/issues2021-07-18T05:53:40Zhttps://gitlab.redox-os.org/redox-os/ion/-/issues/910Nicer error messages2021-07-18T05:53:40ZDiego GanglNicer error messagesRight now, Ion throws error messages like this:
```ion: pipeline execution error: command exec error: Permission denied (os error 13)```
While they are correct and tell you what the problem is, they could be more polished like rustc's e...Right now, Ion throws error messages like this:
```ion: pipeline execution error: command exec error: Permission denied (os error 13)```
While they are correct and tell you what the problem is, they could be more polished like rustc's errors (I'm only talking about the interactive prompt in this case).
### No permissions
```
You don't have permission to open [FILE]. The owner is [USER].
Permissions are: rw--x---
```
### Executables that can't be run
If it doesn't have any exec permissions:
```
Can't run [FILE]. It's not an executable.
Try running chmod +x [FILE].
```
If it has one, but we can't run it:
```
[FILE] is an executable but you don't have permission to run it.
The owner is [USER]. Permissions are: rwx-w---
Try running chmod +x [FILE].
```
### Command not found
```Command not found: pyothn. Did you mean "python"?```
If the command ends with a forward slash, it's a path not a command. The error should be more like:
```Directory not found```Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/907(Re)consider @ token for array expansion - or allow disabling it in interacti...2020-12-12T22:58:09Ztheduke(Re)consider @ token for array expansion - or allow disabling it in interactive modeI love Ion's speed, and used it as my main shell for a while.
But I ultimately stopped due to the big annoyance of the `@` symbol being used for array expansion. (in part... the other element was lack of dynamic complections, which is no...I love Ion's speed, and used it as my main shell for a while.
But I ultimately stopped due to the big annoyance of the `@` symbol being used for array expansion. (in part... the other element was lack of dynamic complections, which is now being worked on in the Shellac effort, which is awesome!)
This now means having to quote every occurence of `@`.
Due to the prevalence of `@` in things you might type in the shell, the token seems like a suboptimal choice.
(Git URLls, database URIs, FTP, emails, ....)
I briefly mentioned this in chat ages ago, and someone brought up the lack of alternative tokens.
If the `@` symbol is already too ingrained or there isn't a viable alternative, another option could be providing an option that disables `@` in the interactive shell to remedy this.Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/900"help" builtin command prints garbage2020-12-12T22:59:12Zngirard"help" builtin command prints garbagetyping `help` gives
```
fnhelpjobsreaddirsends-withexistspushdtestdisowndroptypesetexitisunaliasisattybghistorycalckeybindingsrandomsuspendstarts-withaliastrueboolcontainseqstatuspopdsourcewhichfalsefgmatchescdevalechowaitexec
```typing `help` gives
```
fnhelpjobsreaddirsends-withexistspushdtestdisowndroptypesetexitisunaliasisattybghistorycalckeybindingsrandomsuspendstarts-withaliastrueboolcontainseqstatuspopdsourcewhichfalsefgmatchescdevalechowaitexec
```Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/898Document "Ctrl-c" (clears the line) vs Ctrl-D (clears the scope when typed at...2020-12-17T00:12:58ZngirardDocument "Ctrl-c" (clears the line) vs Ctrl-D (clears the scope when typed at an empty line)After typing ```fn a <return>```, ctrl-c doesn't work, and there's seemingly no way of escaping the REPL, except typing ```end <return>```.After typing ```fn a <return>```, ctrl-c doesn't work, and there's seemingly no way of escaping the REPL, except typing ```end <return>```.Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/886Replace method does not consider strings of zero length to be an input2021-03-18T17:21:54ZMichael Aaron Murphymmstick@pm.meReplace method does not consider strings of zero length to be an inputThis currently gives an error about needing an extra argument
```
echo $replace("foobar" "bar" "")
```This currently gives an error about needing an extra argument
```
echo $replace("foobar" "bar" "")
```Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/881Maps: Assignment does only type check against `str`2021-01-12T16:16:14ZRoland KovácsMaps: Assignment does only type check against `str`* ion revision: 04f7be9
* expected behavior: map assignments are validated against the value type
```
$ let hm:hmap[int] = [ 'a'=0 ]
$ let hm['a'] += 1
ion: assignment error: type error: variable `hm` of type `str` does not support oper...* ion revision: 04f7be9
* expected behavior: map assignments are validated against the value type
```
$ let hm:hmap[int] = [ 'a'=0 ]
$ let hm['a'] += 1
ion: assignment error: type error: variable `hm` of type `str` does not support operator
```
The bug persist for `float` and `int` values types for both `hmap[]` and `bmap[]`.Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/880Multiple LHS values with indexing using math assignment operates on entire array2020-12-12T23:10:27ZRoland KovácsMultiple LHS values with indexing using math assignment operates on entire array* ion revision: 04f7be9
* expected behavior: indexed assignment only applies to the index position.
```
$ let a:[int] = [0 0 0]
$ let b:int = 0
$ let a[1] b += 1 1
$ echo @a
1 1 1 # [0 1 0] expected
$ echo $b
1
```* ion revision: 04f7be9
* expected behavior: indexed assignment only applies to the index position.
```
$ let a:[int] = [0 0 0]
$ let b:int = 0
$ let a[1] b += 1 1
$ echo @a
1 1 1 # [0 1 0] expected
$ echo $b
1
```Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/877Is ion language embeddable into Rust?2020-12-12T23:02:21ZDieter KonradIs ion language embeddable into Rust?Like lua in c?Like lua in c?Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/869Slice syntax doesn't work immediately following a function2020-12-12T23:12:04ZTom AlmeidaSlice syntax doesn't work immediately following a functionI think this is actually related to #868 and probably explains it.
If you have a method that should generate an array and then immediately follow it by a slice pattern, then the slice pattern isn't generated, whereas if you surround the...I think this is actually related to #868 and probably explains it.
If you have a method that should generate an array and then immediately follow it by a slice pattern, then the slice pattern isn't generated, whereas if you surround the method by `[]`, then it works as intended.
```bash
tommoa:~# let multiline = "one
two
three
four"
tommoa:~# for line in @lines($multiline)[..2]
echo $line
end
one
two
three
four
tommoa:~# let second = @lines($multiline)[..2]
tommoa:~# echo $second
one two three four
tommoa:~# for line in [@lines($multiline)][..2]
echo $line
end
one
two
tommoa:~# let second = [@lines($multiline)][..2]
tommoa:~# echo $second
one two
```Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/868For-loop expansion gobbles the end of the line2021-01-07T02:50:24ZAdminXVIIFor-loop expansion gobbles the end of the line`for a in @split("a b c"); echo $a; end` hangs, waiting for an extra end statement.`for a in @split("a b c"); echo $a; end` hangs, waiting for an extra end statement.Ion Shell v1.0.0betamatu3bamatu3bahttps://gitlab.redox-os.org/redox-os/ion/-/issues/866Arbitrary character for array expansion2020-12-12T23:04:37ZAdminXVIIArbitrary character for array expansionThe `@split($(command) "\n")` syntax is too verbose for expansion, and is quite common.
It would be better if Ion had a shorthand notation.
~~Proposition: `@"\n"(command)`, where "\n" can be any arbitrary separator.~~
This could cause c...The `@split($(command) "\n")` syntax is too verbose for expansion, and is quite common.
It would be better if Ion had a shorthand notation.
~~Proposition: `@"\n"(command)`, where "\n" can be any arbitrary separator.~~
This could cause confusion with methods, where `@join(command)` and `@"join"(command)` behave fairly differently. Further more, this would not allow expansion and/or would make it awkward (ex: `@"$var"(command)`)unplannedhttps://gitlab.redox-os.org/redox-os/ion/-/issues/857Tracking Issue: Fast math roadmap2021-06-01T11:49:38ZAdminXVIITracking Issue: Fast math roadmapMath is currently too slow. Proposed roadmap:
- [x] Default to integer, rather than float
- [ ] Store the types, rather than parsing back and forth
- [x] Use lexical for parsing, rather than the stdlibMath is currently too slow. Proposed roadmap:
- [x] Default to integer, rather than float
- [ ] Store the types, rather than parsing back and forth
- [x] Use lexical for parsing, rather than the stdlibIon Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/845Better word by word navigation2021-06-01T11:48:56ZDEVELOPER43Better word by word navigationWhen using `Alt+f` and `Alt+b` for word by word navigation, ion does not detect that special characters are not a part of words. also I think that `Ctrl + Left` for moving the cursor left word by word and `Ctrl + Right` for moving the cu...When using `Alt+f` and `Alt+b` for word by word navigation, ion does not detect that special characters are not a part of words. also I think that `Ctrl + Left` for moving the cursor left word by word and `Ctrl + Right` for moving the cursor right word by word is more ergonomic/supplementary than the current `Alt + b/f`Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/init/-/issues/3Decide on Immediately Relevant Config Options2019-01-31T04:53:31ZSamwiseFilmoremggmugginsmc@gmail.comDecide on Immediately Relevant Config OptionsService configurations currently support cool things like multiple methods, dependencies and provides, environment variables, user and group configuration, and setting redox namespaces. However, there are a couple of corner cases that ha...Service configurations currently support cool things like multiple methods, dependencies and provides, environment variables, user and group configuration, and setting redox namespaces. However, there are a couple of corner cases that have proved more difficult for me to fit into the service configuration file model.
Right now, init's flow looks something like this:
- Initialize logger and the state/metadata graph
- Parse service files from `initfs:/`, add them to the graph, and start them all
- Switch stdio from `debug:` (kernel provided) to `display:1` (the screen, provided by one of the services on `initfs:/`)
- Parse service files from `file:/` (provided by another service from `initfs:/`, `redoxfs`), add them to the graph, and start them all
- Drop into the null namespace and `waitpid(0, 0)`
I mean, this works really pretty well for the standard setup, but its warrants get less flexible as we go down the list:
- Some service on `initfs:/` provides `file:`, and there are services there which _should_ be started
- Some service on `initfs:/` provides 'display:`, and we _should_ switch our output to it
- No more services are going to be added during the lifetime of init
- Services do not need to be checked later and reincarnated if they fail
That third one is particularly sticky, and the fourth is directly contradictory to one of the stated goals of this rewrite. Theoretically, one could install a package that provides a service and want to be able to start it after installing it. However, if init is in the null namespace, it is no longer capable of opening files. That's an easy fix, but the dependency and service starting system are also not nearly robust enough to handle dynamically inserted services which must be brought up, nor are they adequate for dealing with a service failure that requires reincarnation. These are all implementation details, and my plan is to implement some kind of event system internally, which should result in a more flexible state/metadata graph.
The reason I opened this issue is to address how to integrate "special" things, like realizing that services in `file:/` should be parsed, or that init's stdio streams should be piped to `display:1`. I feel like all that stuff should be defined at runtime, but I'm not sure how it fits into the service file model. On this I'd like suggestions. If you'd like to become more familiar with the service configuration file syntax, an example service with many comments can be found in the [examples/](https://gitlab.redox-os.org/redox-os/init/blob/dependencies/examples/example_service.toml) directory. Hopefully that's helpful.Ship Rewrite as DefaultSamwiseFilmoremggmugginsmc@gmail.comSamwiseFilmoremggmugginsmc@gmail.comhttps://gitlab.redox-os.org/redox-os/init/-/issues/2Child Daemonization2019-01-31T04:37:56ZSamwiseFilmoremggmugginsmc@gmail.comChild DaemonizationBased on my understanding of process supervision and [systemd's docs](http://0pointer.de/public/systemd-man/daemon.html#New-Style%20Daemons), daemons that are managed by `init` (which should be all of them) should not fork off and effect...Based on my understanding of process supervision and [systemd's docs](http://0pointer.de/public/systemd-man/daemon.html#New-Style%20Daemons), daemons that are managed by `init` (which should be all of them) should not fork off and effectively daemonize themselves, rather, they should continue to run in the foreground and let their calling process handle daemonizing. Fixing this requires a couple of things:
- [ ] `init` should assume that a service's `methods.start` is a process which runs as a daemon. Also add an option in the service file which can override this, for scripts that run startup tasks, etc.
- [ ] Better service state management
- [ ] Many MR's to many redox repos (the ones that provide daemonized services) in order to
- [ ] Make daemonization opt-outable via an argument (later changed to opt-in/removed after the rewrite is the default)
- [ ] Put service configuration files either in cookbook or in the service's repository (not strictly related but can be bundled with this issue)Ship Rewrite as DefaultSamwiseFilmoremggmugginsmc@gmail.comSamwiseFilmoremggmugginsmc@gmail.comhttps://gitlab.redox-os.org/redox-os/ion/-/issues/834Cannot write functions with variable argument count2023-01-31T05:35:01ZZach ButtonCannot write functions with variable argument countIt appears to only be possible to define functions with a fixed number of arguments.
Perhaps the simplest solution would be some basic polymorphism. Example:
```shell
fn doStuff a b
echo a: $a, b: $b
end
fn doStuff a
doStuff $a "not...It appears to only be possible to define functions with a fixed number of arguments.
Perhaps the simplest solution would be some basic polymorphism. Example:
```shell
fn doStuff a b
echo a: $a, b: $b
end
fn doStuff a
doStuff $a "not_specified"
end
doStuff "test"
# "a: test, b: not_specified"
```
Or, perhaps cleaner, argument expansion:
```shell
fn printSection label ...list
echo -e "\n\n$label:"
for item in @list
echo "- $item"
end
end
printSection todo "type foo" "make bar"
# todo:
# - type foo
# - make bar
```unplannedhttps://gitlab.redox-os.org/redox-os/ion/-/issues/828Process hang with subshell2019-02-09T00:07:39ZMichael Aaron Murphymmstick@pm.meProcess hang with subshellStumbled across an issue that can cause ion to hang:
```
for src in src crates/*; echo $(echo -e "### $src\n ```\n$(tokei $src)\n```"); end
```
It doesn't always happen, but this will usually happen after the second attempt.Stumbled across an issue that can cause ion to hang:
```
for src in src crates/*; echo $(echo -e "### $src\n ```\n$(tokei $src)\n```"); end
```
It doesn't always happen, but this will usually happen after the second attempt.Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/827Syntax validation bug2021-01-08T00:17:27ZMichael Aaron Murphymmstick@pm.meSyntax validation bugManaged to make ion reach some unreachable code:
```
echo "$(echo -e "### src\n ```\n$(tokei src)\n```")"
```
It will only happen if the subshell is double-quoted.Managed to make ion reach some unreachable code:
```
echo "$(echo -e "### src\n ```\n$(tokei src)\n```")"
```
It will only happen if the subshell is double-quoted.Ion Shell v1.0.0betaAdminXVIIAdminXVIIhttps://gitlab.redox-os.org/redox-os/ion/-/issues/805Easy substring removal2023-03-10T13:53:44ZColeman McFarlandEasy substring removalI want to use ion to parse a config that looks like this, where the unique name given before the underscore `_`
is treated as part of a set.
```sh
HOST1_USERFILE=cloud-config/one.yml
HOST1_OS=ubuntu_18_04
HOST1_FACILITY=sjc1
HOST2_USE...I want to use ion to parse a config that looks like this, where the unique name given before the underscore `_`
is treated as part of a set.
```sh
HOST1_USERFILE=cloud-config/one.yml
HOST1_OS=ubuntu_18_04
HOST1_FACILITY=sjc1
HOST2_USERFILE=cloud-config/two.yml
HOST2_OS=ubuntu_18_04
HOST2_FACILITY=sjc1
```
I am using hashmap as a set. The following doesn't _quite_ work, because the "" empty string is not treated as an argument to `@replace`.
```
let hosts:hmap[] = [ ]
let name = $replace("HOST1_USERFILE", "_USERFILE" "")
let hosts[$name] = $name
```
I could do use a space instead of empty string:
```
let name = $replace("HOST1_USERFILE", "_USERFILE" " ") # a space, inst
```
... but the space is preserved in the value of `$name`.
I could use trim #802 when it lands, but a dedicated substring removal method might be nice.Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/803Methods for hmap and bmap handling2021-06-01T12:30:15ZRoland KovácsMethods for hmap and bmap handlingAdd support for getting keys or key-value pairs from maps, as currently only values can be extracted.
```
@keys(map)
@entries(map)
```Add support for getting keys or key-value pairs from maps, as currently only values can be extracted.
```
@keys(map)
@entries(map)
```Ion Shell v1.0.0