Will setting Xonsh as a login shell break system()?

63 views
Skip to first unread message

d33 tah

unread,
Nov 18, 2018, 5:23:41 PM11/18/18
to xonsh
Hi!

As in the title - if I use programs that use system() a lot, will setting Xonsh as a login shell break them? Here's an example of what I mean:

<xonsh>$ HAI='a' bash -c 'echo $HAI'
xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
xonsh: subprocess mode: command not found: HAI='a'
hai=a: command not found

That doesn't seem to be conforming to POSIX, how much of an issue is it really when you switch? Or does Xonsh have a separate POSIX mode that turns on when it's not ran interactively?

~d33tah

Gil Forsyth

unread,
Nov 19, 2018, 9:52:16 AM11/19/18
to d33...@gmail.com, xo...@googlegroups.com
Hey d33tah, 

I'm biased, but I've had xonsh as my login shell for 2 years now and haven't really had any problems.  We are not strictly POSIX-compliant, so there are some habits that you will need to change.  
In regard to your specific example, you can accomplish that if you use `env` to help, e.g.

 ~ 🐚  env BAI="HAI" bash -c "echo $BAI"
"HAI"

Or you can also use the more verbose env-swapping context manager (since we aim for pythonic behavior):

 ~ 🐚  with ${...}.swap(BAI="hello there"):
......     bash -c "echo $BAI"
......
hello there


${...} is a shortcut to the xonsh environment 

I hope that helps!


--
You received this message because you are subscribed to the Google Groups "xonsh" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xonsh+un...@googlegroups.com.
To post to this group, send email to xo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xonsh/210f0d48-e720-4488-b434-fc77bef7d71a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


The information contained in this e-mail is confidential and/or proprietary to Capital One and/or its affiliates and may only be used solely in performance of work or services for Capital One. The information transmitted herewith is intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.

Reply all
Reply to author
Forward
0 new messages