-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix #9103, implementing cd -
in REPL shell mode
#9192
Conversation
The AppVeyor build failed when attempting to connect to status.julialang.org:443. Is there any way to re-trigger it? |
I restarted it for you. Would be nice to add a test for the new functionality, not sure if/where we have any tests of shell mode right now. Maybe |
OK, I made some tests (and I am waiting to see if they work on Windows), but running them displays the new directories to STDOUT it seems.
Perhaps the call to |
Yes, quite likely that call should write to the REPL's stream. |
write(stdin_write, "cd $(tmpdir)\n") | ||
readuntil(stdout_read, "\n") | ||
readuntil(stdout_read, "\n") | ||
@assert pwd() != origpwd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use @test
, not @assert
here
5ba8c48
to
a4dded4
Compare
At this point it works on UNIX-like systems. The Windows test hangs, however, waiting on the REPL to print back the directory after changing directory. I have no way myself of debugging this further. |
To be clear on the status: |
8bbcdb4
to
79efe2a
Compare
@dhoegh would you be willing/able to help debug the windows side of this? |
@@ -60,6 +60,33 @@ write(stdin_write, '\x03') | |||
write(stdin_write, "\\alpha\t") | |||
readuntil(stdout_read,"α") | |||
write(stdin_write, '\x03') | |||
# Test cd feature in shell mode | |||
origpwd = pwd() | |||
tmpdir = mktempdir() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to be changed to tmpdir = escape_string(mktempdir())
due to no escaption takes place when you write to stdin_write
. This effects windows path due to it uses backslashes, but it also effects linux if there is spaces in the path.
Looks like this is passing on win32 now, but would there be any way to avoid the |
63b5a89
to
3aa64ef
Compare
@tkelman I fixed the warning by looking for at most 40 characters when calling |
Great, looks good to me. If no objections or other feedback I think this should be good to merge. |
Fix #9103, implementing `cd -` in REPL shell mode
Thanks for the contribution @garrison! |
Thank you too, @tkelman! |
No description provided.