Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 21 21:57
    codecov-io commented #4062
  • Jan 21 21:34
  • Jan 21 21:34
    moreno-omar starred xonsh/xonsh
  • Jan 21 20:03
    aneeshdurg synchronize #4062
  • Jan 21 19:46
    aneeshdurg opened #4062
  • Jan 21 19:39
  • Jan 21 17:06
    aneeshdurg commented #1614
  • Jan 21 13:44
    maresb edited #4061
  • Jan 21 13:43
    maresb commented #4061
  • Jan 21 13:04
    JunpengMin starred xonsh/xonsh
  • Jan 21 07:48
    fplk starred xonsh/xonsh
  • Jan 20 23:24
    SolidHal starred xonsh/xonsh
  • Jan 20 15:51
    gforsyth commented #4061
  • Jan 20 15:17
    maresb commented #4061
  • Jan 20 15:06
    Prakash2403 starred xonsh/xonsh
  • Jan 20 15:05
    gforsyth commented #4060
  • Jan 20 15:01
    gforsyth commented #4061
  • Jan 20 14:36
    tmsick starred xonsh/xonsh
  • Jan 20 11:20
    dSchaexn commented #4060
  • Jan 19 18:53
    KennethVA starred xonsh/xonsh
halloleo
@halloleo
@anki-code Great resource! Cool! Do you think it is worth it to add the sheet to the xonsh doco?
4 replies
anki-code
@anki-code
:new: New xonsh landing page now available to touch on https://xonsh-landing.github.io/ :tada:
halloleo
@halloleo
Hi all, I have a strange problem: when a prompt formatter field print its information directly because it sends escape sequences to the terminal emulator (example: the builtin vte_new_tab_cwd field) then the characters of the whole prompt don't get send in the right order:
What is printed directly comes before everything else regardless of the order in $PROMPT. However I need to send some escapes after the normal prompt characters. How can I do this?
Andrés E. Castaño Cardenas
@starclouded_gitlab
Hi, currently I am in version 0.9.24 but I am still getting a warning, "NO_COLOR is deprecated and should be replaced with RESET.
7 replies
'any suggestion?
Kermit Alexander II
@DangerOnTheRanger
hey y'all, getting this error upon starting a shell/whenever I try to run xontrib load prompt_ret_code (xonsh --version reports 0.9.24): https://gist.github.com/DangerOnTheRanger/4bad35343d3cc99aa5b47538b116842b
this happened right after I upgraded my system python from 3.8 to 3.9, so that might have something to do with it
4 replies
Povilas Balciunas
@povilasb

Hey guys I have this

# Fail fast, a.k.a set -e
$RAISE_SUBPROC_ERROR = True

exists = bool($(grep "non-existant" file.txt))
if exists: ...

Now this almost works, except that grep returns 1 when it doesn't find the pattern and xonsh will terminate with error due to RAISE_SUBPROC_ERROR set.
I want this to be set in most cases and still be able to rescue myself in some specific cases.
So I do

$(grep "non-existant" file.txt || true)

But then get a SyntaxError due to illegal || use.
So bash logical operators are not allowed? :/

3 replies
Noorhteen Raja NJ
@jnoortheen
Hi people
anyone has workaround for this xonsh/xonsh#4039
halloleo
@halloleo
How do I get a listing of the source code of a function I have defined in the xonsh REPL? I thought which -a my_func does this, but it doesn't.
marcusatiliusregulus
@marcusatiliusregulus
@povilasb are you sure its not complaining about your "true" not being capitalized (True)? ps im still very new to xonsh
1 reply
jan Swedneck
@swedneck:feneas.org
[m]
hey is there an easy way to write to files natively?
i know in normal python scripts i'd do something like with open('file.txt', 'w') as file: file.write('foobar')
but is there some shorter way of doing this in xonsh?
Daniel Shimon
@daniel-shimon
You could do echo -n @(data) > /path
Luc Ritchie
@wlritchi
What's the cleanest xonsh equivalent to bash's $! to get the PID of the most recent background job? I'm hoping for a simple equivalent of
long_running_process &
pid=$!
do_something_else
kill $pid
4 replies
Tim Jones
@TimJones
Hi all! I'm just getting started with xonsh, and I usually like the solarized theme for working, but something seems to be up with the colours in xonsh...
image.png
I'm using Konsole also set to the Solarized-dark theme, not sure if there is a conflict there or I'm not setting the theme right or something, but it doesn't match the colors of solarized at all
I'd be happy to submit an issue (a PR if I find the time) but I'd just like to know if this isn't a PEBKAC error first ;)
1 reply
Started to import all the aliases from zsh to xonsh...
btw lets make a discord server? xD
Asaf Fisher
@AsafFisher
Btw i noticed that we do not compile and cache imports on xsh files.. this cause a large time panalty if you import stuff on xonshrc... maybe we should possibly
1 reply
  1. make an “include” import like mechanisem for the xonshrc that just appends a file: include xonsh_aliases
  1. Alternative is to compile every import to pyc
Chi Nguyen
@cnfolio
any suggestions on how to convert bash export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH" to xonshrc setting? I tried using methods on https://xon.sh/bash_to_xsh.html and kept getting error messages about "can only concatenate str (not "list")" or "maximum recursion depth exceeded in comparison"; thx
Chi Nguyen
@cnfolio
found path literals on https://xon.sh/tutorial.html; cheers
1 reply
Asaf Fisher
@AsafFisher
Matthias Bussonnier
@Carreau

Hey all, new machine with branch new conda and xonsh, conda active fails with:

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

I thought that was fixed ?

Matthias Bussonnier
@Carreau
seem I just had to be explicit with conda init xonsh....
Jim Lynch
@jwlynch_gitlab
is there a difference between login shell and non-login shell? if yes, what are the differences? (do login shells read a different startup file? or, is there a variable set true/false in a login shell?
Matthias Bussonnier
@Carreau
Login shell do behave a bit differently and read I believe the .xxx_profile in addition to .xxxxrc or vice versa. You can read https://unix.stackexchange.com/questions/38175/difference-between-login-shell-and-non-login-shell
Most shell have an option to start them as (non)-login shell.
Jim Lynch
@jwlynch_gitlab
right, sounds like bash does that.... do the docs for xonsh document this same behavior?
halloleo
@halloleo
@jwlynch_gitlab @Carreau From what I know xonsh has only the startup files ~/.xonshrc and /etc/xonshrc.
Jim Lynch
@jwlynch_gitlab
I think that;s what the man page says too... can you confirm that xonsh will also read .xonsh_profile if it's a login shell?
if it does, that makes it a documentation bug... if it does not, maybe it should
jan Swedneck
@swedneck:feneas.org
[m]
uh, what about $XDG_CONFIG_HOME/xonsh/rc.xsh ?
halloleo
@halloleo
True, doco states "XDG compliance". Haven't tried it though.
Jim Lynch
@jwlynch_gitlab
@halloleo yeah, as far as I can tell from the docs, looks like that to me too... but that brings me back to the question: what's the difference between a xonsh login shell and a non-login shell?
halloleo
@halloleo
@jwlynch_gitlab I think a non-login xonsh shell (e.g. from a subprocess line like xonsh my_awsome_script.xsh) will not read the .xonshrc, whereas xonsh -l my_awsome_script.xsh will do so. However I haven't tested this explicitly.
Jim Lynch
@jwlynch_gitlab
good theory, we can both check that
so far, I know: running xonsh and xonsh -l both run that script
what I don't know for sure, is whether running xonsh without -l is or is not a login shell
Jim Lynch
@jwlynch_gitlab
maybe there's some kind of thing that could be tested to see if it's a login shell or not, like a variable or some kind of function call
otherwise I don't (at all) understand the difference between login shell and non, and it's starting tl look like the whole concept is not useful
Jim Lynch
@jwlynch_gitlab
don't get me wrong, I like xonsh a lot, this is just one aspect that is either not implemented properly, or I don't understand the proper implementation that it does have
Jim Lynch
@jwlynch_gitlab
if xonsh can't inform a xonsh script of whether it's a login shell or not, does that indicate that the whole concept of login/non-login shells is not needed in xonsh?
Jim Lynch
@jwlynch_gitlab
another thing, ctrl-Z / bg /fg is not working properly
Jamie Bliss
@AstraLuma
today in $DAYJOB, someone found the pycon 2016 talk, and we got to talking about how to use xonsh on old-ubuntu (py3.5) blades without shared logins/homedirs