ion issueshttps://gitlab.redox-os.org/redox-os/ion/-/issues2021-06-01T11:13:04Zhttps://gitlab.redox-os.org/redox-os/ion/-/issues/994Scopes: can not change variables in function from matches, conditionals or loops2021-06-01T11:13:04Zmatu3baScopes: can not change variables in function from matches, conditionals or loopsbug: values in same function scope are not writable from matches, conditionals or loops.
Additionally, one can not write into variables of higher scope. We need to clarify the syntax for this.
expect: It should be possible to write valu...bug: values in same function scope are not writable from matches, conditionals or loops.
Additionally, one can not write into variables of higher scope. We need to clarify the syntax for this.
expect: It should be possible to write values in functions.
code: input
```sh
let x = 4
let y = 0
let z = 0
let a = 4
fn demo
if test 1 == 1
let x += 1
end
echo "x:" $x
if test $x != 5
echo "x broken"
end
for i in {0..=4}
let z += 1
end
echo "z:" $z
if test $z != 5
echo "z broken"
end
match $a
case 4; let a += 1
case _; echo "FAIL"
end
echo "a:" $a
if test $a != 5
echo "a broken"
end
#echo $y
#while test $y -lt 5
# let y += 1 # BROKEN: does not update y
# #echo $y
#end
#echo "y:" $y
#if test $y != 5
# echo "y broken"
#end
end
demo
echo $x
echo $y
echo $z
echo $a
```
actual: output
```txt
x: 4
x broken
z: 0
z broken
a: 4
a broken
4
0
0
4
```
expect: output
```txt
x: 5
y: 5
z: 5
a: 5
5
5
5
5
```
version: e033ca1c0c2ff8d1932137d2ed7354d003ad9cdc
interaction: noneIon Shell v1.0.0betamatu3bamatu3bahttps://gitlab.redox-os.org/redox-os/ion/-/issues/991Simplify slicing2020-12-12T21:56:29Zmatu3baSimplify slicingfeat: Remove edge cases
BREAKING CHANGE: progams relying on slicing MUST be revalidated
perf: impact
performance none
usability increase
maintainability increase
code: input
```sh
let array = [{1..10}]
let array2 = [{1...10}]
echo...feat: Remove edge cases
BREAKING CHANGE: progams relying on slicing MUST be revalidated
perf: impact
performance none
usability increase
maintainability increase
code: input
```sh
let array = [{1..10}]
let array2 = [{1...10}]
echo @array
echo @array2
```
expect: output
```
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
```
actual: output
```
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 10
```
reason: better usability and remove edge case
context: We should reuse the inclusive annotation for slicing to simplify working with the shell.
```
let array2 = [{1..=10}]
```Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/990Unterminated single quotes may run arbitrary commands2022-11-26T09:23:24Zmatu3baUnterminated single quotes may run arbitrary commandsbug: The shell does not create and error upon a wrong let binding with single quotes. It appears to run arbitrary commands, when further single quotes appear.
If you are lucky, it creates a core dump.
expect: Not silently accepting a wr...bug: The shell does not create and error upon a wrong let binding with single quotes. It appears to run arbitrary commands, when further single quotes appear.
If you are lucky, it creates a core dump.
expect: Not silently accepting a wrong grammar (for files). The REPL should also indicate, that the string is not terminated.
related: #959 #949
code: input
```sh
let a = 'ab''
```
expect: output
```
ion: syntax error: unterminated single quote
```
version: f05b74e7f3ba96a667a343cd07de212183757b8d
interaction: Alacritty with ion
context: terminal multiplexers may prevent faster core dumpIon Shell v1.0.0betamatu3bamatu3bahttps://gitlab.redox-os.org/redox-os/ion/-/issues/988Array slicing is broken2021-01-03T07:28:42Zmatu3baArray slicing is brokenbug: The manual claims array slicing is possible, whereas this is not true.
expect: outcome description
related: #973
code: input
```
let array = [{0...5}]
echo @array[0,3..]
```
expect: output
```
0 3 4 5
```bug: The manual claims array slicing is possible, whereas this is not true.
expect: outcome description
related: #973
code: input
```
let array = [{0...5}]
echo @array[0,3..]
```
expect: output
```
0 3 4 5
```Ion Shell v1.0.0betamatu3bamatu3bahttps://gitlab.redox-os.org/redox-os/ion/-/issues/986setup CI and regression tests for macOS2021-06-01T10:24:06ZRoland Teppsetup CI and regression tests for macOSmacOS: install: illegal option -- D
I was trying to install ion shell on macOS and this is the error I am getting when executing `sudo make install`
```bash
❯ sudo make install prefix=/usr
install -Dm0755 target/release/ion //usr/bin/i...macOS: install: illegal option -- D
I was trying to install ion shell on macOS and this is the error I am getting when executing `sudo make install`
```bash
❯ sudo make install prefix=/usr
install -Dm0755 target/release/ion //usr/bin/ion
install: illegal option -- D
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 file2
install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 ... fileN directory
install -d [-v] [-g group] [-m mode] [-o owner] directory ...
make: *** [install] Error 64
```
Google search suggests that -D option does not exist under macOS/Darwin and suggests using -d instead, but I am not experienced enough with install utility (or Makefile) to understand the subtle differences of the two and fix it myself.Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/980let HISTORY_TIMESTAMP = 1 doesn't work2020-12-12T22:01:00ZPerry Thompsonlet HISTORY_TIMESTAMP = 1 doesn't workSetting `let HISTORY_TIMESTAMP = 1` in my ~/.config/ion/initrc file, and then running `ion`, when I run `echo $HISTORY_TIMESTAMP` the output is `0` and my history has no timestamps.
I'm running Gentoo Testing with the master branch of i...Setting `let HISTORY_TIMESTAMP = 1` in my ~/.config/ion/initrc file, and then running `ion`, when I run `echo $HISTORY_TIMESTAMP` the output is `0` and my history has no timestamps.
I'm running Gentoo Testing with the master branch of ion (commit 935811eafdd0436acc5f6981d1fef20076c54c5c).Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/975Manual: super and global namespaces example doesn't demonstrate the feature2021-06-02T19:24:13ZbakaManual: super and global namespaces example doesn't demonstrate the featureThe [Scopes (super and global namespaces)](https://doc.redox-os.org/ion-manual/html/variables/07-namespaces.html#scopes-super-and-global-namespaces) example is as follows:
```
let a = 1
fn demo
let b = 2
fn nested
echo ${super...The [Scopes (super and global namespaces)](https://doc.redox-os.org/ion-manual/html/variables/07-namespaces.html#scopes-super-and-global-namespaces) example is as follows:
```
let a = 1
fn demo
let b = 2
fn nested
echo ${super::b}
echo ${global::a}
end
nested
end
demo
```
This code is functionally equivalent to:
```
let a = 1
fn demo
let b = 2
fn nested
echo $b
echo $a
end
nested
end
demo
```
This doesn't demonstrate the super and global namespace feature since $a and $b can be accessed just fine without using them.
In fact, I could not find any situation where this feature would apply. The [Scopes chapter](https://doc.redox-os.org/ion-manual/html/variables/06-scopes.html) says `Functions have the scope they were defined in.` which from my understanding implies a function always has access to the "super" scope (and if applied recursively, the global scope).
One guess was that this feature was meant to a situation like this where the variable is defined in the scope the function was called from:
```
fn print_vars
echo ${super::y}
end
if test 1 == 1
let y = 3
print_vars
end
```
However that doesn't work (and I guess is unnecessary since you can pass variables to functions as a parameter).Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/971Disabling autosuggest2020-12-13T00:45:40Zcinerea0Disabling autosuggestCurrently, I do not see any way in the documentation to disable the autosuggestion feature. Is this planned for the future? Additionally, if this feature is planned, will it be possible to disable the autosuggestion feature without disab...Currently, I do not see any way in the documentation to disable the autosuggestion feature. Is this planned for the future? Additionally, if this feature is planned, will it be possible to disable the autosuggestion feature without disabling the history substring search functionality?Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/958Tracking Issue Documentation2020-12-12T22:18:47Zmatu3baTracking Issue Documentation#939 fn description
#923 absolute paths
#913 startup practice (init scripts)
#907 github and mail have @ which is reserved
#905 missing feature in help command
#898 shortcut
#897 lambda function?
#895 slicing syntax inconsi...#939 fn description
#923 absolute paths
#913 startup practice (init scripts)
#907 github and mail have @ which is reserved
#905 missing feature in help command
#898 shortcut
#897 lambda function?
#895 slicing syntax inconsistency in manual
#893 usage inside virtualization
#810 history reverse searchIon Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/955bug: arithmetic expansion can not handle nested brackets `()`2020-12-12T22:19:45Zmatu3babug: arithmetic expansion can not handle nested brackets `()`bug: description
expect: proper handling of brackets
related: #938
code: input
```
echo $(((1 + 1)))
```
expect: output
```
2
```
Actual output `ion: syntax error: syntax error: ')' at position 15 is out of place`
kernel: linux5.6....bug: description
expect: proper handling of brackets
related: #938
code: input
```
echo $(((1 + 1)))
```
expect: output
```
2
```
Actual output `ion: syntax error: syntax error: ')' at position 15 is out of place`
kernel: linux5.6.3-2
version: `ion --version` ion 1.0.0-alpha 1fbd29a6d539faa6eb0f3186a361e208d0a0bc05Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/947Make a new release2020-12-12T22:25:36Zwucke13Make a new releaseThe last release is quite old. AFAIK so old, that it won't even compile on stable as of now. Please make a new release.The last release is quite old. AFAIK so old, that it won't even compile on stable as of now. Please make a new release.Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/942bug: Panic when `[` is not closed.2022-11-26T09:23:25ZechoSayonarabug: Panic when `[` is not closed.When I tried to assign an array to a variable, I missed to close parenthesis and then `ion` panicked. I tried to reproduce this behavior and found that using `[` without `]` after `let foo =` cause panic. If I forget to close other paren...When I tried to assign an array to a variable, I missed to close parenthesis and then `ion` panicked. I tried to reproduce this behavior and found that using `[` without `]` after `let foo =` cause panic. If I forget to close other parenthesis, `ion` does not panic but only `[` just after `let foo =` cause panic. I append examples to reproduce the error.
```
let foo = ( // => syntax error
let foo = { // => syntax error
let foo = [ // => panic!
( // => syntax error
{ // => syntax error
[ // => syntax error
let boo = (1, 2, // => syntax error
let boo = {1, 2, // => syntax error
let boo = [1, 2, // => panic!
```Ion Shell v1.0.0betamatu3bamatu3bahttps://gitlab.redox-os.org/redox-os/ion/-/issues/940Ctrl+W in vi mode doesn't erase the word before the cursor2020-12-13T00:46:37ZÉrico Nogueira RolimCtrl+W in vi mode doesn't erase the word before the cursorHey there! In vi mode, Ctrl+W doesn't have any effect, even though it has the intended effect in Emacs mode (erasing the word behind the cursor).Hey there! In vi mode, Ctrl+W doesn't have any effect, even though it has the intended effect in Emacs mode (erasing the word behind the cursor).Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/938`++=` and `::=` operators act on numeric types2020-12-12T22:33:13ZRoland Kovács`++=` and `::=` operators act on numeric types
When a variable is updated in a `let` binding the numeric types (`int` and `float`).
```rust
let i:int = 1
let i ::= -
let i ++= .5
echo $((-i + 0.5))
1
```
*ion version*: f9f2ae0
When a variable is updated in a `let` binding the numeric types (`int` and `float`).
```rust
let i:int = 1
let i ::= -
let i ++= .5
echo $((-i + 0.5))
1
```
*ion version*: f9f2ae0Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/924Script calling with parameter for ion results in ion only evaluating the para...2020-12-16T18:02:06Zmatu3baScript calling with parameter for ion results in ion only evaluating the parameter and quiting the scriptDefer ion parameters [program or path name shall never start with - or -- (otherwise it gets messy to parse/decide)]
Case 1: If most leftward argument is ion option, only valid ion options may follow or error.
Case 2: If not, defer e...Defer ion parameters [program or path name shall never start with - or -- (otherwise it gets messy to parse/decide)]
Case 1: If most leftward argument is ion option, only valid ion options may follow or error.
Case 2: If not, defer evaluation to use explicit statement (later to be specified).
Other solution would explicitly check all most leftward arguments ever to evaluate for shell option, which looks inefficient.
```
#!/usr/bin/env ion
echo 'test'
```
called by
`# ./test.sh --version`
result:
ion 1.0.0-alpha (x86_64-unknown-linux-gnu)
rev a5fb10c7741be5108d262e03db33b48360279cc6Ion Shell v1.0.0betamatu3bamatu3bahttps://gitlab.redox-os.org/redox-os/ion/-/issues/923question+manual: What is the proper way for passing absolute paths?2020-12-12T22:44:21Zmatu3baquestion+manual: What is the proper way for passing absolute paths?Often scripts are called from a relative path, in my case `/opt/scripts/`.
Sadly tab completion only shows me the program, but on enter I cd to that folder.
So I need to type the whole path manually, which is a pain.
What would you sugg...Often scripts are called from a relative path, in my case `/opt/scripts/`.
Sadly tab completion only shows me the program, but on enter I cd to that folder.
So I need to type the whole path manually, which is a pain.
What would you suggest, aside of setting $PATH or adding all folders to initrc, to circumvent that?Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/916HISTFILE doesn't appear to work in ion-1.0.5 (Arch Linux)2020-12-13T00:20:28ZSteven PeaseHISTFILE doesn't appear to work in ion-1.0.5 (Arch Linux)In ~/.config/ion/initrc I placed:
```
source "${HOME}/.profile"
let HISTFILE="${HOME}/.histfile"
export TERM="xterm-256color"
which omniprompt > /dev/null || cargo install --git https://github.com/spease/omniprompt.git
fn PROMPT
&& om...In ~/.config/ion/initrc I placed:
```
source "${HOME}/.profile"
let HISTFILE="${HOME}/.histfile"
export TERM="xterm-256color"
which omniprompt > /dev/null || cargo install --git https://github.com/spease/omniprompt.git
fn PROMPT
&& omniprompt 0 || omniprompt "E"
end
```
This still doesn't appear to use .histfile . In the end, I replaced the default history location with a symlink and it worked. However, it'd be preferable for the config setting to work.Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/914Missing end quote on export command generates weird errors2022-11-26T09:23:26ZSteven PeaseMissing end quote on export command generates weird errors```
export GEM_HOME="${HOME}/something
```
This can cause anywhere from `assignment error: GEM_HOME: variable does not exist` to `extra values were supplied, and thus ignored` depending on the following commands.
If this is intentional...```
export GEM_HOME="${HOME}/something
```
This can cause anywhere from `assignment error: GEM_HOME: variable does not exist` to `extra values were supplied, and thus ignored` depending on the following commands.
If this is intentional, I'm guessing the intention was to allow strings spanning newlines?
An error when there's an uneven number of quotation marks etc. would be nice to have.Ion Shell v1.0.0betamatu3bamatu3bahttps://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/905`history` command not listed in `builtins.md`2020-12-17T00:06:00Zngirard`history` command not listed in `builtins.md`Shouldn't `history` be listed in `builtins.md` ?Shouldn't `history` be listed in `builtins.md` ?Ion Shell v1.0.0betamatu3bamatu3ba