4 ms·
I've been using xonsh since 2018 - on both Windows and Linux. I love it. It's not as responsive as a C based shell (e.g. Bash), but you get over it and the pros
by BeetleB 3y ago
I've been using xonsh since 2018 - on both Windows and Linux. I love it. It's not as responsive as a C based shell (e.g. Bash), but you get over it and the pros heavily outweigh the cons.
If you love Bash scripting, xonsh isn't for you. For everyone else, xonsh is.
The only serious headache I have with it - very poor compatibility with fzf. None of the main developers use fzf so they don't feel the pain. As an example, doing:
git checkout $(git branch | fzf)
doesn't work because the result of the fzf command has a newline. So you need something like @$(...).
What I really want is to swap the default TAB autocompletion with an fzf selection, and there's no easy way to do it. You have to get deep into the underlying prompt_toolkit library and do a lot of surgery. It's doable, but I haven't had the time.
- antongribok 3y agoI've been using Xonsh as my main shell for about the same time. I love it as well. However, I feel like your criticism re fzf is not really fair, because I run into this with other tools quite often. So often in fact that it took me only a second to convert your command in my head to this: git checkout @($(git branch |fzf).strip())
- BeetleB 3y agoAs I said, it's doable, but painful. If I show your command to most non-Xonsh users, it would be an immediate turnoff. Do they really have to put strip at the end of each command? Or keep track of which need it and which don't? It's very unergonomic. And the history of fzf support in xonsh has been much worse. Until recently, the command you wrote was not guaranteed to work, because doing anything with fzf under $() would (seemingly) randomly not capture the results of fzf (it would often be any empty string). This was a long standing issue for years, until we finally had a user who knew the xonsh internals well enough to go and debug it. So people like me had to find alternative ways to use fzf (e.g. attach it to a custom keybinding for specific tasks). I had to modify xontrib-fzf-widgets (because that itself failed often). Take a look at these issues: https://github.com/xonsh/xonsh/issues/5190 https://github.com/xonsh/xonsh/issues/5190 https://github.com/xonsh/xonsh/issues/5189 https://github.com/xonsh/xonsh/issues/5189 https://github.com/xonsh/xonsh/issues/2404 https://github.com/xonsh/xonsh/issues/2404 (note that it took 4 years to fix this - and until then your command would not reliably work). https://github.com/xonsh/xonsh/issues/3548 https://github.com/xonsh/xonsh/issues/3548 https://github.com/xonsh/xonsh/issues/3035 https://github.com/xonsh/xonsh/issues/3035 (probably a clone of 2404). The reality is: If people want to use fzf in xonsh the way they do in bash/zsh, they will be in for a lot of pain.