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
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.
Once that process has been defined, your proposal could be handled according to it.
anki-code
@anki-code
Got it, thanks! We're working hard to make complete description in #3924. It's not the XEP process description it's a complete subproc substitution approaches overview. If anyone know enogh how to build XEP process this should be described in distinct issue and will be great.
anki-code
@anki-code
:newspaper: After a month of waiting and approving, xonsh was added to awesome-python list - the second "awesome" list by count of stars in "awesome" community. Thanks to all who put the like and support the pull request! :tada:
1 reply
halloleo
@halloleo
I'm back on xonsh keybindings via prompt-toolkit: I looking for keybindings like Right Key for accepting the suggestion from the history when you start typing. Where is that in the source code? (I looked for @bindings.add, but couldn't find it.)
3 replies
halloleo
@halloleo
So the Autosuggestion key binding is set in ptk? Alright. But where are all these shortcuts then documented? Somehow couldn't find it in the ptk readthedocs ...
And I don't mean the list of possible keys but the actual keys used (like Right for accept autosuggest, C-e fir end of line, etc, etc).
David Strobach
@laloch
Yeah, the PTK docs are not that comprehensive in this respect. Just read the source :wink:
halloleo
@halloleo
@laloch Fair enough.
The PTK docs talk about vi and emacs bindings. Which ones are choosen for xonsh? For me C-e goes to the end of the line which matches what Emacs does, so I guess xonsh uses Emacs style, right?
Anthony Scopatz
@scopatz
There is a $VI_MODE env var that lets you switch between them, IIRC
halloleo
@halloleo
Thanks. Just found in ptk that C-e in autosuggest mode does the same as Right key. Handy. Even better ESC-f does partial autosuggest completion! :-)
halloleo
@halloleo
When using prompt-toolkit, how can I select a filename completion without executing it? let's say I have a dir with two file file1.txt and file2.txt.
I type ls file hit tab and get a list with file1.txt and file2.txt. With the cursor keys I can select one. Now when I confirm the selection with enter it completes as I want, but executes the statement as well. How can I just confirm without executing, so that I can type more stuff in that line?
7 replies
Anthony Scopatz
@scopatz
Hey all! Just FYI, I am on holiday this week, so that is why I am a little slow responding to issues & PRs
3 replies
eggcaker
@eggcaker
176011604479074_.pic_hd.jpg
Hi all, I want use the xontrib-kitty to display the chart on kitty terminal ,after load the xontrib-kitty make a simple plt.plot(range(10)), i got a very big chart like this, did I missing some setup ?
Anthony Scopatz
@scopatz
That looks like the matplotlib xontrib
anki-code
@anki-code
:new: New xontrib-hist-format - to get commands and output from history as Markdown and post it to Github in copy-pastable manner.
eggcaker
@eggcaker
@scopatz ??
Anthony Scopatz
@scopatz
It looks like the figsize is wrong for some reason
anki-code
@anki-code
:star2: 4000 stargazers :tada:
Ganesha Sharma
@Ganesha2282882
how do i force manjaro nibia (20.2) to use xonsh? i installed it with pacman and then pip