5 ms·
XonSH has been my main shell for a solid two years now. The concept is awesome, but unfortunately it has many flaws. * Nesting bash and python scripts makes pe
by roblabla 8y ago
XonSH has been my main shell for a solid two years now. The concept is awesome, but unfortunately it has many flaws.
* Nesting bash and python scripts makes performance terrible compared to using python's subprocess module directly. I have a xonsh script at [0], with an equivalent written in straight bash. The python scripts ends in less than a second, the xonsh script takes ages.
- As a sub-problem of the above: You can't ctrl+c while in a python function in xonsh. That stinks.
* $(program) returns a string that ends with a \n. In bash, when the program returns a single line, the \n gets stripped.
* It sometimes has problems with certain interactive programs. My last experience with this was sudoedit starting neovim in xonsh caused neovim to crash. XonSH -> Neovim works. Bash -> Sudoedit -> neovim works. but Xonsh -> Sudoedit -> Neovim doesn't.
And that's just a small list of my biggest gripes that I keep running into. I really hope to see the project improve though! Despite all the bugs, it's still my favorite shell by a mile.
[0] https://gist.github.com/roblabla/d82c440908d08c8a232ac483e6be7202 https://gist.github.com/roblabla/d82c440908d08c8a232ac483e6b...
- jijojv 8y agoFiled https://github.com/xonsh/xonsh/issues/2815 https://github.com/xonsh/xonsh/issues/2815 $ yes test | tee /tmp/xonsh.log $ wc -l /tmp/xonsh.log 208076 /tmp/xonsh.log bummer ctrl+c does eventually work several seconds later (about 10x slower) which is still a deal breaker as it could be disastrous when you need to abort a mistyped command or for scripts that give you a few seconds to abort before it does something the destructive step...
- austinpray 8y agoI use zsh daily but type `xonsh` any time I do something in the shell that would normally require a google. “Uh ok so I have this JSON file. When I pipe this to `jq` I forget: to pivot an array of objects to an object keyed by array[x].id is it like `to_entries` then chain it to `map`? Uhh let’s look at the docs...” However in Python I can write that function at the speed of thought. It may be a couple more lines of code but I’m also 100% confident in the output. Like I understand some people can legitimately program in bash [0]. But I just can’t bring myself to practice. Why would anyone inflict this language on themselves? [0] https://github.com/docker-library/python/blob/master/update.sh https://github.com/docker-library/python/blob/master/update....
- joelthelion 8y ago> Like I understand some people can legitimately program in bash [0]. But I just can’t bring myself to practice. Why would anyone inflict this language on themselves? Bash has a lot of pitfalls, but once you learn how to deal with them, it can also be quite superb for some tasks. Piping the output of a complex set of loops into GNU parallel and watching your computer process stuff at blazing speed is a very nice experience. Doing the same in python would be many time more verbose.
- type0 8y agoBash combined with utilities is like a swiss knife of scripting, you won't be doing any major woodwork with it but it sure is a heck of a useful tool.
- piotrkubisa 8y ago> I use zsh daily but type `xonsh` any time I do something in the shell that would normally require a google. Personally, I stopped using `jq` in favor of python oneliners, they a bit more verbose but also cross-compatible, works out of the box (not everyone has jq, but most of people have python (pre)installed on their machines) and it is easy to implement a oneliner, i.e.: curl -X GET "https://httpbin.org/json" -H "Accept: application/json" | python -c 'import sys, json; print(json.load(sys.stdin)["slideshow"]["author"])' Do xonsh helps you write a tar command without googling [0] or browsing a man? [0]: https://xkcd.com/1168/ https://xkcd.com/1168/