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
Does it work under Windows/Cygwin? #514
Comments
You may need to install gnureadline or use prompt-toolkit instead. |
Thanks for reporting @tkossak |
|
What terminal emulator are you running in? Also are you using cygwin's Python? Also, what is the output of: import xonsh.tools
print(xonsh.tools.ON_WINDOWS, xonsh.tools.ON_LINUX, xonsh.tools.ON_POSIX) I bet this is xonsh becoming confused about whether you are on windows or posix. |
This might be the first report of anyone running in cygwin. |
hehe, I'm forced to use windows at work so the least I can do to make it behave like real os is installing cygwin :) My terminal emulator: mintty + tmux (and everything inside Cmder/ConEmu)
In xonsh:
and the code you asked inside xonsh:
|
What version of ply are you on? Are you sure you aren't running xonsh in python 2? |
ran inside xonsh:
|
OK. I have no idea what is going on here. Can you try asking on the mailing list or maybe stack overflow. Unfortunately, I don't have access to a windows system to test things out myself. But maybe other xonsh-windows users could try it out on cygwin. |
I don't get any errors; I just don't get anything. I run CTRL-C to exit gives me a traceback. RE: "gnureadline or use prompt-toolkit instead" - I installed Latest (as of today) cygwin x64.
(xonsh) foo@foo.com ~/
$ python
Python 3.4.3 (default, May 5 2015, 17:58:45)
[GCC 4.9.2] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import xonsh.tools
>>> print(xonsh.tools.ON_WINDOWS, xonsh.tools.ON_LINUX, xonsh.tools.ON_POSIX)
False False True
>>> import ply
>>> ply.__version__
'3.7' As far as xonsh being confused about the platform it's running on, this is the xonsh command I ended up with. Interesting. |
Hi @tildebyte - thanks for reporting. Can you run the from xonsh import xonfig
xonfig.main([]) |
|
Hi @tildebyte - OK it looks like it is getting stuck in the foreign shell phase on startup. Can you try adding a config file that does not load in any foreign shells, as described http://xon.sh/xonshconfig.html Basically make {} We should probably remove bash from the default foreign shells on posix. |
Hmm. Neither |
Hmm. Is your |
or tuple. |
|
@tkossak could you try running xonsh through a debugger or profiler to see where the problem is coming from? |
I feel like the error is probably something trivial if we could identify what it is. |
When I checked xonsh today I have the same results as @tildebyte - after running
I tried running trace (using python Everything was run in Cygwin x64 (if it matters at all). Hope it helps. |
Ok, not sure if this will do anything, but maybe you could try setting |
This seems to be getting hung up on running path manipulation while running subprocesses. In particular, it is not happy with:
|
Running |
I'm in a similar position here, though I don't seem to be getting very far into the startup. Running
At that point it just hangs indefinitely. I have tried the suggestions above, but I suspect this isn't getting far enough for those to be the problem. However, piping to stdin seems to bring me up to the error noted in the previous comments (note commands are being run, the output ending up amongst the stack trace):
Output from
|
what happens if you do exactly, import xonsh.tools
xonsh.tools.ON_WINDOWS = False in the xonshrc file? |
I think that the problem is that it is picking up the Windows subprocess model, when it should get the UNIX model since you are on Cygwin |
also is there a reliable way to detect we are on cygwin? |
Using the xonshrc doesn't seem to make a difference ( As for detecting Cygwin, we have these:
The latter varies by Windows version and 32/64 variant, but appears to always begin with |
@adqm I have recently updated my Cygwin install. DLL version is 2.5.1. |
@ellocogato, and you're still seeing that |
@adqm Yes, I still see it. I am currently setting up a clean Cygwin environment on a different machine to test xonsh, and I'll report whether that issue shows up there as well. Edit: I finished the setup on the other machine, and the experience is the same. Still getting the delay (if anything, it's even longer on the other machine); still occasionally getting a |
@ellocogato, @OllieTerrance: I just put in #1192, which for me fixes the issue with xonsh backgrounding itself. It required hooking in to Cygwin's but anyway, it's in! Would you mind giving it a look? I still haven't been able to reproduce the issue with the |
I'm also attempting to use this on Cygwin (x64). After the 0.3.4 update, I run
When I try to get my xonfig:
Not sure what I did wrong. It sort of worked with 0.3.3 (huge delays upwards of half a second to a second after running |
Hi @jivanyatra! There is a workaround for the As for the other issue...it's hard to say. I think the |
Thanks @adqm !! So,
I saw that I didn't have prompt_toolkit or pygments installed, so I installed them. Now, I get this result from
EDIT: okay so the above no longer occurs. I exited xonsh, ran
|
@jivanyatra, thanks! That |
If there's anything else I can provide, I'm happy to help. I'm a new python dev and this project definitely caught my attention. I'd love to contribute as well, but I'm not sure what I could do with my admittedly novice skill level. |
@ellocogato: Weird! Okay, so maybe this makes it even more crucial to fix that issue. I wish I could reproduce it personally (I still haven't been able to). Is that backgrounding also fixed with |
@adqm OK, one more thing to throw in the mix. Not sure if this was happening before #1192, but I just noticed that sometimes instead of a
|
I feel like that had been reported elsewhere as well, and I think I know of a likely fix. I'll try to put in another PR tonight. Do you mind helping to test if I'm not able to reproduce myself? |
Regarding |
Alright, great! Then we've just got that one last thing to track down, it seems, before this works as expected on Cygwin. My hopes are high! |
Okay, after more testing, I'm seeing the same thing as @ellocogato. And there is no more backgrounding occurring. |
Great; thanks for all the help! |
This was long thread so haven't looked at all of it. |
This seems to be working much better now. 😄 Only thing I'm seeing now is the 2-3 second delay redrawing the prompt, which was mentioned earlier -- is anyone else still seeing this? ( |
@vmiheer, yes this is a known issue that should be fixed in the next release (via #1192 and #1193). As a workaround in the meantime, you should be able to use @OllieTerrance: Great! Glad to hear it is working now. We will get this into the next release for sure. It is also true that #1166 (also going in to the next release) will remove the VCS branch information from the prompt, which should speed things up drastically while still giving a somewhat nice looking prompt. As for the RPi, xonsh is pretty heavy-weight for a shell, so I expect there isn't much we can do about it on the pi. |
@adqm PR #1193 does prevent the occasional But now I get some new ones! I have seen a Also note that I put some debugging output in this error handling code, and I noticed that every time
|
@ellocogato: just updated the patch. do you mind giving it another shot? thanks for all the help with testing this! |
@adqm: the update to the patch seems to completely resolve the issue. Is there any consequence of the fact that these errors are occurring (and that they are now being ignoring)? |
@ellocogato: maybe... i guess in the worst case, there could still be a process floating around someplace. i'm not too worried about that, though, since i would imagine the only way we could hit some of these errors is if the processes are already dead and gone... |
Alright, I think we've mostly taken care of these issues. I'm going to close for now. Feel free to re-open (or to open another issue) if problems persist under Cygwin. |
Windows 7 x64
Cygwin x86
Python3 3.4.3
I installed xonsh with
pip3 install xonsh
and when I try to run it withxonsh
I get the error:The text was updated successfully, but these errors were encountered: