ion issueshttps://gitlab.redox-os.org/redox-os/ion/-/issues2021-09-20T10:56:42Zhttps://gitlab.redox-os.org/redox-os/ion/-/issues/1008Alias names cannot containt semicolons2021-09-20T10:56:42ZA1ex-NAlias names cannot containt semicolonsI have aliases in bash and fish that contain semicolons. For example, ":q" for "exit". In ion, this does not work.
`ion: alias name, ':q', is invalid`I have aliases in bash and fish that contain semicolons. For example, ":q" for "exit". In ion, this does not work.
`ion: alias name, ':q', is invalid`https://gitlab.redox-os.org/redox-os/ion/-/issues/1002Cannot create empty slices when range start with the array length2021-05-31T23:26:46ZNils ErikssonCannot create empty slices when range start with the array lengthbug: It's not possible to create an empty slice when the start range starts with the arrays current length.
expect: That the slicing range 1.. would skip the first element and print nothing if the array only had one element.
related: n...bug: It's not possible to create an empty slice when the start range starts with the arrays current length.
expect: That the slicing range 1.. would skip the first element and print nothing if the array only had one element.
related: none
code: input
```
let foo=[bar]
echo @foo[0..]
echo @foo[0..0]
echo @foo[0..1]
echo @foo[1..]
echo @foo[1..1]
let foo=[bar baz]
echo @foo[0..]
echo @foo[0..0]
echo @foo[0..1]
echo @foo[1..]
echo @foo[1..1]
```
expect: output
```
bar
\n
bar
\n
\n
bar baz
\n
bar
baz
\n
```
actual: output
```
bar
\n
bar
ion: expansion error: invalid index
ion: expansion error: invalid index
bar baz
\n
bar
baz
\n
```
kernel: 5.12.4-arch1-2
version: ion 1.0.0-alpha (x86_64-unknown-linux-gnu)
rev 1170b84587bbad260a3ecac8e249a216cb1fd5e9
interaction: Run each command after the other
behavior of rust:
code:
```
fn main() {
let foo=vec!["bar"];
println!("{:?}", &foo[0..]);
println!("{:?}", &foo[0..0]);
println!("{:?}", &foo[0..1]);
println!("{:?}", &foo[1..]);
println!("{:?}", &foo[1..1]);
let foo=vec!["bar", "baz"];
println!("{:?}", &foo[0..]);
println!("{:?}", &foo[0..0]);
println!("{:?}", &foo[0..1]);
println!("{:?}", &foo[1..]);
println!("{:?}", &foo[1..1]);
}
```
output:
```
["bar"]
[]
["bar"]
[]
[]
["bar", "baz"]
[]
["bar"]
["baz"]
[]
```https://gitlab.redox-os.org/redox-os/ion/-/issues/961Allow pipeing of control flow constructs2020-12-12T22:16:32ZIan WahbeAllow pipeing of control flow constructsfeat: Allow piping of control flow constructs
BREAKING CHANGE: This should not break anyone's code, as it is purely additive.
perf: impact
This should not change performance.
Usability of shell increases, as it removes the need for ...feat: Allow piping of control flow constructs
BREAKING CHANGE: This should not break anyone's code, as it is purely additive.
perf: impact
This should not change performance.
Usability of shell increases, as it removes the need for unnecessary temporary variables.
This makes user code marginally more maintainable, as it should remove boilerplate code.
code: input
```
let x = 0
while test $x -le 5; echo $xl; let x += 1; end | grep 2
if true; echo "foo"; else; echo "bar"; end > output.txt
cat output
```
expect: output
```
2
foo
```
reason: Allow more complicated operations. This would include creating and filtering a loop, then outputting it to a file. This would make the language more consistent and functional (as in the paradigm).
behavior of bash/dash/zsh/fish/oil
bash and zsh have this functionality.unplannedhttps://gitlab.redox-os.org/redox-os/ion/-/issues/930feat: pipeline execution error: process ($pid) ended by signal SIGINT (ion in...2020-12-12T22:37:43ZBafDycefeat: pipeline execution error: process ($pid) ended by signal SIGINT (ion in dolphin)Dolphin (KDEs default file manager) has a rather cool feature which allows one to have a terminal pane within the file manager. The file navigation pane and the terminal are also linked. For example if the user navigates to a different d...Dolphin (KDEs default file manager) has a rather cool feature which allows one to have a terminal pane within the file manager. The file navigation pane and the terminal are also linked. For example if the user navigates to a different directory in the file browser, dolphin issues a `cd $dir` inside the terminal and when the user does a `cd $dir` inside the terminal, the file browser pane is updated accordingly.
However, when using ion, the following error message is displayed after each `cd` command (issued by dolphin, not when the user manually enters the `cd` command):
```
ion: pipeline execution error: process ($pid) ended by signal SIGINT
```
where `$pid` is the pid of ion (and it still lives after the command was completed). Also, the `cd` command works as it should (i.e. the directory IS changed).
I don't think that this is a serious issue (it doesnt really bother me much yet) and just wanted to report it for completeness :)https://gitlab.redox-os.org/redox-os/ion/-/issues/928auto pushd mode (ability to customize try_cd)2021-03-19T16:30:53Zunrelentingtechauto pushd mode (ability to customize try_cd)In zsh, it is possible to `setopt auto_pushd`, which turns ordinary `cd` — including implicit/auto cd (!) — into pushd. Would be very useful to have the ability to pushd when just typing the directory name only in ion.In zsh, it is possible to `setopt auto_pushd`, which turns ordinary `cd` — including implicit/auto cd (!) — into pushd. Would be very useful to have the ability to pushd when just typing the directory name only in ion.https://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/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/779Tracking Issue: Supported Types For Type-Checking2021-06-01T12:00:24ZMichael Aaron Murphymmstick@pm.meTracking Issue: Supported Types For Type-CheckingWe should evaluate and expand upon our current set of supported types. Here's a basic set of what we could support:
- **[T]**: an array of like-values
- **str**: a string -- the default type
- **bool**: either `1` or `0`
- **float**: a ...We should evaluate and expand upon our current set of supported types. Here's a basic set of what we could support:
- **[T]**: an array of like-values
- **str**: a string -- the default type
- **bool**: either `1` or `0`
- **float**: a generic decimal of any size
- **int**: a generic integer of any size, which may be negative
- **i32**: 32-bit int
- **i64**: 64-bit int
- **i128**: 128-bit int
- **uint**: a generic integer of any size, which may not be negative
- **u32**: 32-bit uint
- **u64**: 64-bit uint
- **u128**: 128-bit uintIon Shell v1.0.0