-
Notifications
You must be signed in to change notification settings - Fork 597
Don't quote ~[username]/ in scp paths. #368
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
Conversation
In order for tilde expansion to work, a leading tilde and any subsequent alphanumeric characters up to and including the first slash must not be quoted. This commit changes the quoting algorithm to forego quoting the initial tilde (if present), any subsequent alphanumerics, and the first slash. If the first character is not a tilde then there is no change. PATH BEFORE AFTER ~ '~' ~ ~user '~user' ~user foo~bar 'foo~bar' 'foo~bar' ~/foo '~/foo' ~/'foo' ~ foo bar '~ foo bar' ~' foo bar'
Not sure why Travis is failing. It seems not to have updated after I fixed the lint problem on line 231. |
Just wondering if there was a reason you went with this approach over escaping whitespace and not using quotes at all which you talked about in the initial bug report. |
After taking a closer look at the implementation, I became concerned about introducing bugs because it's not clear exactly which characters besides whitespace would need to be escaped. My understanding is that the paths are evaluated by the shell, which means characters like |
Would you prefer I change it to use the method we talked about originally? |
This is fine with me, anyone using SCP have a chance to test this patch out? |
…es in file paths
gnachman/iTerm2@d1ccf10 applies this patch to the nightly build of iTerm2. I'll see if anyone hollers. I've tested it on my Ubuntu machine. Not sure how testing usually works on this project? |
I'll humbly point to #243, which is waiting for a merge, but has the necessary infrastructure (or at least easier to use). And I'll gladly take care of any additional testcases, as long as they are green 😉. Right now I've only added things I'm sure of and/or have been able to write non-bogus testcases for (writing the harness is also somewhat a WIP). There's also a ci/more-testcases branch in my fork which has the "tentative" ones (sftp, agent, and scp). |
@tiennou That's a big diff. If I merge that into my fork, how do I run the tests and where's the right place to add mine? |
Here's a few "documentation" points, sorry for the terseness : There should be a I just noticed I have some rebasing to do (a test was added for agent forwarding), so I'm currently having to bring in some of the helpers added afterwards to be able to support the new test. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@gnachman Any reports on this PR after landing it in iTerm? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
In order for tilde expansion to work, a leading tilde and
any subsequent alphanumeric characters up to and including
the first slash must not be quoted.
This commit changes the quoting algorithm to forego quoting
the initial tilde (if present), any subsequent
alphanumerics, and the first slash. If the first character
is not a tilde then there is no change.
See issue #349