You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[thorsten] > cd directory with space
[thorsten] > pwd
Path
----
F:\cygwin\home\thorsten
Standard behaviour:
[thorsten] > cd directory with space
Set-Location : A positional parameter cannot be found that accepts argument 'with'.
At line:1 char:1
+ cd directory with space
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Location], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetLocationCommand```
The text was updated successfully, but these errors were encountered:
thorstenkampe
changed the title
No error changing to unquoted directory
No error changing to unquoted directory with space in name
Feb 10, 2018
Nice spot, thanks. I've fixed this for the time being although I'm not 100% happy with it as is.
The issue being that an unquoted path with a single space in it like program files is seen as the two argument variant of cd (Transpose-Location). (i.e. cd program files is translated to cd: program files which fails silently in the case that no replacement is found.
I've added a heuristic for now so that Transpose-Location isn't invoked in the case that either of the arguments begins with a directory separator but I'm open to better suggestions.
This is possibly related to #3:
Standard behaviour:
The text was updated successfully, but these errors were encountered: