Hacker News new | ask | show | jobs
by antongribok 855 days ago
I'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())
1 comments

As 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/5189

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/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.