git branch | fzf | tee -, then fzf's stderr won't be captured and things will work fine (but of course, fixing the code would be preferable!). I've found a good work around is to throw tee on the end, e.g. If one of the fantastic Xonsh devs could weigh in on whether or not this tiny patch is acceptable, that'd be good! I'm happy to write up some tests for it and submit a PR. My other patch is a little more involved and is more of a workaround than a fix, so I'm more interested in this one first, as it takes xonsh in the right direction (IMO). This changes things such that the final process in a spec won't have its stderr captured unless the capture mode indicates it should be, which should be closer in behaviour to what more traditional shells do, and matches the documentation for $() (it currently kind of matches the doc, but I won't go into it). _safe_pipe_properties(w, use_tty=use_tty) R, w = pty.openpty() if use_tty else os.pipe() Last.stderr = None # must truly stream on windows I'm still happy to help out with debugging the issues I've found though. I've gone back a couple of releases and this has been present in all of them for me.ĮDIT: If it's any consolation to people who want to be able to use something in the meantime, I've found that neither of my issues occur with or, so I'm just going to migrate to using one of these. In case it's relevant, I've tried this with both readline and prompt_toolkit, same result. ![]() A race condition of some sort, maybe? I'm not sure how best to debug xonsh, so if there's anything I can do to help figure this out, let me know. I've straced fzf and verified that it is indeed writing '* master\n' to stdout in both situations, so I'm not sure what's going on. ~/projects/xonsh master $ $OUTPUT = $(git branch | fzf) | encoding errors | surrogateescape ~/projects/xonsh master $ $OUTPUT = $(git branch | ~/projects/xonsh master $ (Note: Run the Wizard or create a ~/.xonshrc file to suppress the welcome ~/projects/xonsh master $ xonfig Xonfig wizard -> Run the configuration wizard and claim your shell Xonfig tutorial -> Launch the tutorial in the browser
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |