3 ms·
There are so many neo-shells that go crazy with colors, autocompletions, & SQL-like features while the most basic problems (like handling of newlines/spaces/int
by hello_computer 1y ago
There are so many neo-shells that go crazy with colors, autocompletions, & SQL-like features while the most basic problems (like handling of newlines/spaces/international chars) are mostly swept under the rug with -null/-print0, which is more hack than solution. I think Tom Duff's rc shell was an excellent start in that direction, which sadly went nowhere.
- chubot 1y agoYSH addresses the "string safety" problem: What is YSH? https://oils.pub/ysh.html https://oils.pub/ysh.html I am writing a quoting module now, but the key point is that it's a powerful enough language to do so. It is more like Python or JS; you don't have to resort to sed to parse and quote strings. I posted the quote-argv solution above -- in YSH it will likely be: var argv = :| ls 'arg with space' | # like bash argv=() ssh example.com $[quote.sh(argv)] But you can write such a function NOW if you like --- quote.sh follows the (subtle) idiom of replacing a single quote ' with '\'' which means it works on systems with remote POSIX sh, not just YSH ! e.g. "isn't" in POSIX shell is quoted as 'isn'\''t' which is these three word parts: 'isn' \' 't' YSH also has: - JSON, which can correctly round trip every Unicode string, without writing your own parsing functions - JSON8, an optional extension that can round trip every byte string you get from the Unix kernel https://oils.pub/release/latest/doc/j8-notation.html https://oils.pub/release/latest/doc/j8-notation.html
- hello_computer 1y agoI like it. Hope it gets some traction.
- chubot 1y agoIt also fixes the problem with eval that is shared with ssh: ysh-0.29$ eval ls $dir eval ls $dir ^~~~ [ interactive ]:11: 'eval' requires exactly 1 argument And it fixes word evaluation YSH Doesn't Require Quoting Everywhere - https://www.oilshell.org/blog/2021/04/simple-word-eval.html https://www.oilshell.org/blog/2021/04/simple-word-eval.html https://oils.pub/release/latest/doc/simple-word-eval.html https://oils.pub/release/latest/doc/simple-word-eval.html
- o11c 1y agoTo be fair, most of those "basic problems" have basic solutions as long as you're not trying to avoid GNU tools. The nastiest case is probably `globasciiranges`.