Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:21
    liebkne starred xonsh/xonsh
  • 02:21
    beetleb commented #3640
  • 02:13
    BrutalSimplicity starred xonsh/xonsh
  • Jan 25 21:37
    gforsyth closed #2418
  • Jan 25 21:37
    gforsyth commented #2418
  • Jan 25 21:37

    gforsyth on master

    Add $HISTCONTROL=ignorespace su… (compare)

  • Jan 25 21:37
    gforsyth closed #4062
  • Jan 25 18:31
    aoirint starred xonsh/xonsh
  • Jan 25 17:23
    james5deutschland commented #4065
  • Jan 25 17:20
    james5deutschland commented #4065
  • Jan 25 17:06
    kumuji starred xonsh/xonsh
  • Jan 25 16:34
    aneeshdurg synchronize #4062
  • Jan 25 15:30
    gforsyth commented #4066
  • Jan 25 15:29
    gforsyth commented #4066
  • Jan 25 14:57
    gforsyth commented #4065
  • Jan 25 00:59
    danieljabailey edited #4066
  • Jan 25 00:54
    danieljabailey opened #4066
  • Jan 24 19:40
    deeuu commented #3640
  • Jan 24 15:20
    yishibashi starred xonsh/xonsh
  • Jan 24 14:35
    stepney141 starred xonsh/xonsh
Anthony Scopatz
@scopatz
You could try something like xonsh -c! echo "hello"
Anthony Scopatz
@scopatz
If anyone on @xore is available, I'd love a review on xonsh/xonsh#3850 in order to get the next release out. Thanks!
Anthony Scopatz
@scopatz
Happy to announce 0.9.23 is out!
5 replies
anki-code
@anki-code
We did it! :tada: :tada: :tada: :+1: :muscle:
wendellwt
@wendellwt
good for 0.9.23! Q: can I change the behavior of existing tab-completers? Or to get something slightly different, do I need to write my own completer function? I would like argument-completion to look in the current directory first, but current completers don't seem to do that.
3 replies
anki-code
@anki-code
:new: New xontrib-sh - paste and run sh-compatible (bash/zsh/fish) commands in xonsh. Just start with ! and paste the commands to execute. The shell (bash/zsh/fish) will be found automatically.
Anthony Scopatz
@scopatz
:tada:!
Austin Bingham
@abingham
When I use xontrib load vox_tabcomplete I trigger an assertion ("/usr/local/Cellar/xonsh/0.9.23/libexec/lib/python3.9/site-packages/xonsh/parsers/base.py", line 2215, in apply_trailers assert False). Any idea what's going on?
2 replies
eggcaker
@eggcaker
hi all, is there a way to capture the command result , i has a cmd build with python mode like : cmd = 'ssh user@sshserver.com cat ~/myfile' , then i want to capture the result the cmd returns , but if i ran ``` result = $(@(cmd)) i got command not found
Anthony Scopatz
@scopatz
@eggcaker - in that example, cmd should be a list of str.
cmd = 'ssh user@sshserver.com cat ~/myfile'.split()
$(@(cmd))
should work
eggcaker
@eggcaker
@scopatz how about pipeline ?
Anthony Scopatz
@scopatz
I think it would have to be something like $(@(cmd1) | @(cmd2))
eggcaker
@eggcaker
mean , I cannot include the "|" inside the cmd
Anthony Scopatz
@scopatz
That's right. The pipe joins commands
eggcaker
@eggcaker
like : cmd = '.... myfile | rg my_search'.split()?
Anthony Scopatz
@scopatz
At least, that is how it is implemented now
You could use execx or similar to execute a block of code, but that wouldn't capture in the way that you want
hmmm actually
You might be able to create an ExecAlias out of the command, and then capture the alias
This is little hacky but it would look something like:
aliases['__my_piped_cmd__'] = '.... myfile | rg my_search'
$(__my_piped_cmd__)
I haven't tried that, but it might work
eggcaker
@eggcaker
yes , i known that way, it's works well, this time i just write some script quickly just want concat the command generate with python loop and run that command capture the result
David Strobach
@laloch
The following forks for me:
$ cmd = "cat ~/.xonshrc | grep '^$.*='"
$ execx(f"cmdout=$({cmd})", glbs=globals())
$ echo @(cmdout)
eggcaker
@eggcaker
Thanks @laloch this way works
eggcaker
@eggcaker
with $(@(cmd1) | @(cmd2)) seems not working
wait .. maybe not ...
eggcaker
@eggcaker
@scopatz $(@(cmd1) | @(cmd2)) works too ,my bad thanks @scopatz @laloch
Anthony Scopatz
@scopatz
cool thanks!
matrixbot
@matrixbot
Phase Hi, I would like to give a try to xonsh... would you have a website, wiki, sort of knowledge base with those kind of tricks? It looks feasible but strange for someone with a bash background :)
David Strobach
@laloch
Yeah, there's https://xon.sh with quite a lot of documentation at https://xon.sh/contents.html#guides.
David Strobach
@laloch
btw, as far as I can tell, the above in-place variable expansion with complex command pipeline is not possible in bash either.
Anthony Scopatz
@scopatz
@laloch - yeah it isn't.... it is super hard to pull off because the parser has to delay evaluating certain tokens until the after the parsing is done
It is kind of a catch-22 which is why I haven't seen a language that is able to actually implement it
matrixbot
@matrixbot
Phase I haven't read in detail but it looks like eval "$cmd1 | $cmd2" . Anyway. Thx!
Anthony Scopatz
@scopatz
BTW folks I am hoping to do a weekly release tonight
anki-code
@anki-code
great!
Anthony Scopatz
@scopatz
v0.9.24 is out!
anki-code
@anki-code
:tada: :muscle: :rocket: :tada:
anki-code
@anki-code
:newspaper: I found xontribs on Github and ask the authors to add xontrib topic and preview images to the xontrib repos. As result we have 34 xontribs in Github Topics - https://github.com/topics/xontrib - and part of them have cute preview images. Take a minute to look and star most interesting!
:bookmark: Also I improved Cookiecutter template to create xontribs and you can find the one minute way to create xontrib, publish it to PyPi and the list of actions to promote xontrib in the template README. Feel free to xontribution!
Anthony Scopatz
@scopatz
Thanks for the updates @anki-code!
anki-code
@anki-code
:new: New concept of the introduction image (it's not 4 images, it's one image with 4 blocks):
image.png
CaféHaine
@cafehaine
v0.1.3 of xontrib-xlsd is now released ! with support for $LS_COLORS, a bugfix for circular symlinks, and a screenshot in the README to fulfill your daily need of pretty pictures!
anki-code
@anki-code
cool xontrib! :tada:
Anthony Scopatz
@scopatz
xlsd is great! Thanks for the really nice release @cafehaine!
anki-code
@anki-code
I've added xonsh to many awesome lists on github and one of the major list is "awesome-python".
:star: Please like the first comment in this PR -> vinta/awesome-python#1623 or add new comment like "Yeah I'm using xonsh!" or just "+1".
Starring the awesome-python repo will be good too.
anki-code
@anki-code
:new: I rewrited all my xontribs from xsh to py that enables compilation the files to pyc and work faster.
And now I've made "The pack of ergonomic xontribs" - xontrib-ergopack - meta package that includes all my xontribs. To install and load all xontribs just run pip install xontrib-ergopack && xontrib load ergopack.
1 reply