-
-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for the exec builtin #84
Comments
This wouldn't be significantly different from the source-bash alias that lives in aliases.py. Pull requests welcome! |
AFACS the |
@vitaut yes, but it shouldn't be enabled by default. The way to do this is to stick the following in xonshrc or elsewhere: aliases['exec'] = aliases['xexec'] This will override the Python built-in |
Fair enough, I'll add it to There is one issue with passing absolute paths to
|
@scopatz it looks like even with the alias entry in .xonshrc $ exec
<built-in function exec> |
Ahh yes, this is almost certainly a builtin issue since del exec
aliases['exec'] = aliases['xexec'] If that doesn't work, try this: import builtins
del builtins.exec
aliases['exec'] = aliases['xexec'] This could break many things... |
@scopatz Unfortunately neither workaround works with exceptions at xonsh startup in both cases. In the first case I get exception:
And in the second:
Is there a way to make xonsh interpret |
Agreed, but there is no way to tell from the syntax that it is a builtin. |
I'll think about this |
This $ mosh example.com
xonsh: subprocess mode: command not found: exec
Did you mean one of the following?
ex: Command (/usr/bin/ex)
xev: Command (/usr/bin/xev)
xexec: Alias
rec: Command (/usr/bin/rec)
etex: Command (/usr/bin/etex)
ssh_exchange_identification: Connection closed by remote host
/usr/bin/mosh: Did not find remote IP address (is SSH ProxyCommand disabled?). If |
Hi @kseistrup - we actually don' overload or reassign You can always reassign this yourself to exec. For example, in the xonshrc you could do: aliases['exec'] = aliases['xexec'] Does mosh set any environment variables that would let us know that we are running in mosh? |
I'm afraid that doesn't help. The answer is still
|
After some further testing I have determined that xonsh isn't even getting to the point where the xonshrc file is being read in and executed. Something else is going on here... |
I have opened mobile-shell/mosh#663 for this issue, @kseistrup |
Ok, I have now found that mosh works well if you add the following line to your .xonshrc aliases['exec'] = aliases['xexec'] I am running completely as the same user on localhost though. We can certainly add this alias when automatically when certain SSH environment variables are present, if you'd like. When you said that this didn't help before, what problem were you seeing exactly? |
Mea culpa. I tried aliases['exec'] = aliases['xexec'] in the terminal before running |
I'm going to close this and move the discussion of the absolute path support to a separate issue. |
Thanks @vitaut. Also, @kseistrup, yeah that wouldn't work. You need to put this in the rc file since a new session is started when you enter mosh. ssh was eating the stdout, which is why I thought it wasn't getting run at all. |
It would be useful if xonsh supported the exec Bourne shell builtin as some programs (such as Qt Creator) rely on it which requires using a different shell for them.
Currently trying to use
exec
fails withFileNotFoundError
:The text was updated successfully, but these errors were encountered: