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/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/979History is not saved2020-12-27T23:41:17Zbm-stschneiderHistory is not savedbug: description
When I have a terminal open I can type `history` and see the history of commands. When I open the file it stays empty
expect: outcome description
History persists sessions
kernel: mac10.14.6
version:
ion 1.0.0-alpha (...bug: description
When I have a terminal open I can type `history` and see the history of commands. When I open the file it stays empty
expect: outcome description
History persists sessions
kernel: mac10.14.6
version:
ion 1.0.0-alpha (x86_64-apple-darwin)
rev 044565f9d2817bcea4f8549578a8bfa52f849c32
context: Alacrittyhttps://gitlab.redox-os.org/redox-os/ion/-/issues/963bug: source-sh broken, improve documentation2020-12-16T00:59:25Zmaxice8bug: source-sh broken, improve documentationI'm trying to use `source-sh` to get some variables from an Alpine Linux APKBUILD into the environment of the Ion shell.
The APKBUILD looks like this:
```
# Contributor: dai9ah <dai9ah@protonmail.com>
# Maintainer: dai9ah <dai9ah@proto...I'm trying to use `source-sh` to get some variables from an Alpine Linux APKBUILD into the environment of the Ion shell.
The APKBUILD looks like this:
```
# Contributor: dai9ah <dai9ah@protonmail.com>
# Maintainer: dai9ah <dai9ah@protonmail.com>
pkgname=2bwm
pkgver=0.3
pkgrel=0
pkgdesc="Fast floating window manager"
url="https://github.com/venam/2bwm"
arch="all"
license="ISC"
makedepends="libxcb-dev xcb-util-keysyms-dev xcb-util-wm-dev xcb-util-xrm-dev"
options="!check" # no test suite
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/venam/2bwm/archive/v$pkgver.tar.gz"
prepare() {
default_prepare
sed -i Makefile -e "/CFLAGS/{s/+=-Os /+=/}"
}
build() {
make
}
package() {
make PREFIX=/usr DESTDIR="$pkgdir" install
}
sha512sums="088a97e5245287890c72e2b0685f7348a4cc0fd49582893b7ce7a081f80a4d7454a3c0eadf4609589314351ded02fd8b75548019b782e797350ad5db5c939f92 2bwm-0.3.tar.gz"
```
After sourcing it with `source-sh` i expect the variables in the root of the document to be accessible from Ion.Ion Shell v1.0.0https://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/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.0betamatu3bamatu3ba