Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:29
    henrebotha opened #3997
  • 09:24
    lose0101 starred xonsh/xonsh
  • 09:24
    lose0101 starred xonsh/xonsh
  • 09:12
    holmescn starred xonsh/xonsh
  • 07:40
    anki-code commented #3668
  • 07:39
    anki-code commented #3668
  • 05:43
    grovesteyn commented #3991
  • 04:15
    jnoortheen commented #3995
  • 04:13
    jnoortheen commented #3995
  • 04:13
    jnoortheen commented #3995
  • 04:00
    jnoortheen synchronize #3996
  • 02:21
    scopatz commented #3991
  • 02:20
    scopatz edited #3991
  • Nov 25 23:06
    daniel-shimon commented #3668
  • Nov 25 22:54
    jos128 starred xonsh/xonsh
  • Nov 25 20:38
    eredhan starred xonsh/xonsh
  • Nov 25 19:48
    scopatz commented #3995
  • Nov 25 19:48
    scopatz commented #3950
  • Nov 25 19:44
    scopatz commented #3983
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
AlexeyKlimov
@AlexeyKlimov
Hello all. I'd like to switch from bash to xonsh for scripting and I'm worried that because of a typo my python command could be interpreted in subprocess mode and would do smth dangerous. Is there a way to force explicit calling of subprocess commands (e.g. ![ls -l])? Is this really a problem in real life xonsh scripting, btw?
anki-code
@anki-code
@AlexeyKlimov I'm not so old user of xonsh and writed around 10 thousands of lines and use it as the main shell prompt. And my answer: just start writing. During my experience I never have any problems with subproc vs Python mode.
Yes, you can use ![] calls to be sure that you're in subprocess mode.
anki-code
@anki-code

from bash to xonsh

Moreover I believe that the question around "xonsh VS bash VS zsh VS etc" is wrong because xonsh has abilities to live with sh-shells under one umbrella. The question is how to use "xonsh AND bash AND zsh and ..." during the work and what is the good patterns of work for this.

For example if you have strong muscle memory on writing bash spells you can just do in xonsh prompt:

bash -c! echo 'spell on bash'

Or use xontrib-sh for short command.

AlexeyKlimov
@AlexeyKlimov
@anki-code I'm perfectly fine with writing scripts in python, since I know python and don't like using bash at all. I'm just scared that I could mistype var name in xonsh script and my python line becomes a valid sh line that's able to delete smth
anki-code
@anki-code
I think you can't give me an example )
I believe you can imagine a synthetic example but it will not the real life example.
AlexeyKlimov
@AlexeyKlimov
Definitely I can't :) That's why I wanted to clarify this thing with more experienced xonsh users
anki-code
@anki-code
My simple advice is if you plan to rm something just double check the arguments and behavior. This advice is the completely similar if you planning to rm something on bash :)
If you think you will write python line with rm variable and it will be subprocess command it's fantastic imho :))
Also good to read bash to xonsh manual - https://xon.sh/bash_to_xsh.html
AlexeyKlimov
@AlexeyKlimov
got it. Thanks for help
anki-code
@anki-code
I know that in some articles about xonsh some devops like to post comments with the concerns like you described. I have fun while reading it. It's an imagination based on imagination.
Welcome to xonsh! =)
David Strobach
@laloch
@AlexeyKlimov, I don't think Xonsh is more dangerous than other shells in this respect. You can shoot yourself in foot using bash as well. For instance rm="*" is equally valid and equally dangerous in both :wink:
Gil Forsyth
@gforsyth
@AlexeyKlimov -- in addition to @anki-code and @laloch 's comments, I'd also point out that if you are inclined, xonsh is much easier to write unit tests for, which might help allay some of your concerns
anki-code
@anki-code
@AlexeyKlimov I want to add about testing. If you really have a complex code that create-delete massive amount of files and you need to test it without risk of affecting to the home environment then just use the docker container. It's isolated environment without any affection to the home host.
To run xonsh in docker (https://hub.docker.com/r/xonsh/xonsh):
docker run -it --rm xonsh/xonsh:slim
anki-code
@anki-code
:new: Guys and girls! We have a great concept around subprocess operators. Take a look at - https://github.com/xonsh/xonsh/issues/3924#issuecomment-715625964
anki-code
@anki-code
:new: Folks! The new PR with captured subproc logic changes - xonsh/xonsh#3926
Please review. Maybe you have special cases or examples around this changes.
CaféHaine
@cafehaine
unfortunately this still doesn't behave like bash's $()
My use case for $() is for the following command:
yay -Rcs $(yay -Qdtq). This command (on arch linux with yay installed) makes each line of the output of $(yay -Qdtq) an argument for yay -Rcs, but xonsh doesn't seem to split arguments on newlines/spaces
8 replies
anki-code
@anki-code
Thanks @cafehaine ! Good point.
halloleo
@halloleo
@laloch In the github discussion on $() I found teh following code snippet: abbrevs["$$"] = '@($(<edit>).rstrip("\\n"))'. What does the <edit> part mean and is it somewhere documented?
4 replies
halloleo
@halloleo
Ups, sorry for the pasted "rubbish" didn't see it when posting from the iPad app. Will try to remove it when back on a computer.
Raphael Das Gupta
@das-g

Re https://github.com/xonsh/xonsh/pull/3926#issuecomment-716235905

It looks like there was a lot of discussion already over here

No. In this questions there is a lack of feedback but it's core question.

Lack of feedback? Both issue #3924 and PR #3926 are mere 2.5 days old and have received comments since. Give things some time, @anki-code. Not all of us contribute to Xonsh 24/7.

anki-code
@anki-code

@das-g Thanks for your attention! It's appreciated. I know. But I see by another issues past year that activity is very low.

Anthony wrote:

But the bigger the effects of the change, like with subprocess syntax, the more people are going to need to weigh in on the pros/cons and the more forethought will need to be put into it.

And because the change is very closer to core I mentioned contributors. Sad but xonsh hasn't another ways. No social network publics or something like this.

Raphael Das Gupta
@das-g
Well, that's why it was suggested to set up a Xonsh enhencement proposal (XEP) process. Part of that would have to be on how to get the attention of the relevant stakeholders.
anki-code
@anki-code
Anthony writes short answers and many of them are not clear and sometimes he doesn't clearly understand the question or code because he has lack of time. I understand and appreciate his time and I try to ask xore feedback but hear silence in most cases. I'm not in hurry I'm just try to open contructive dialogue.
In case of XEP there are no links about what is it and what I should to do. Google shows nothing.
Raphael Das Gupta
@das-g
Sorry, that was maybe unclear: The Xonsh community doesn't yet have a defined process on how to handle enhancement proposals. (At all, so not just related to your proposal.) It though seems like such a process would be needed, so the fist step would be to define such a process.