Skip to content
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

1.3.6: Error on start path with trailing slash in quotes. #1862

Closed
2 tasks done
Pathduck opened this issue Aug 26, 2018 · 9 comments
Closed
2 tasks done

1.3.6: Error on start path with trailing slash in quotes. #1862

Pathduck opened this issue Aug 26, 2018 · 9 comments

Comments

@Pathduck
Copy link

Pathduck commented Aug 26, 2018

Purpose of the issue

  • Bug report (encountered problems/errors)
  • Question

Description of the issue

Not sure if bug or question, so both.

I use Total Commander to launch Cmder in a specific directory, with the following pattern:
cmder.exe /start "%p"

%p represents the path of the source directory in TC, and will be sent to the process. The quotes are needed if spaces are present.

Since upgrading from 1.3.4 to 1.3.6 this does no longer work, and I get the following error messages:

clipboard

According to the README, this should also be a valid argument

/START [start_path] | Folder path to start in.

I have found some other issues giving the impression that now Cmder starts in the "current working directory", or that the correct argument should be maybe /dir but this does not work either.

In 1.3.4 the help dialog looked like this:

image

The help dialog in 1.3.6 is a mess to be honest, in addition to the glaring typo in the first message. Why are there [] around the argument, and why a OR ( | ) with the same on both sides? It's very confusing.

I have also found the following:

  • When launch with a trailing \ the above error appears, then the usage dialog.
    Cmder.exe /start "g:\download\"

  • Without a trailing slash, Cmder launches, but only in %userprofile%.
    Cmder.exe /start "g:\download"

@daxgames
Copy link
Member

daxgames commented Sep 1, 2018

cmder /start %windir% works for me, opens in c:\Windows. /start is indeed a valid command line parameter.

@daxgames daxgames closed this as completed Sep 1, 2018
@daxgames daxgames reopened this Sep 1, 2018
@daxgames
Copy link
Member

daxgames commented Sep 1, 2018

Cmder 1.3.6 starts by default in the current working directory vs previous versions always starting in %userprofile%

@Pathduck
Copy link
Author

Pathduck commented Sep 1, 2018

@daxgames The problem appears to be failing to handle trailing slashes along with quotes.

It appears the /start argument is optional, as it will try to start in the first directory given, not sure if that's intentional.

Compare, from the cmd prompt:

Cmder.exe /start "g:\temp\Spaced Dir\" - fails and gives first the (wonky) "Folder doses not exist" error, then "Unrecognized parameter" error.
Cmder.exe "g:\temp\Spaced Dir\" - fails and gives "Unrecognized parameter".
Cmder.exe /start "g:\temp\Spaced Dir" - works.
Cmder.exe "g:\temp\Spaced Dir" - works.
Cmder.exe g:\temp - works.
Cmder.exe g:\temp\ - works.

TC will however send the full directory with a trailing slash, this worked in 1.3.4.
%windir% will not have a trailing slash.

So it's the combination of quotes and a trailing slash that makes it fail.

And the help dialog doesn't really help...

@daxgames
Copy link
Member

daxgames commented Sep 2, 2018

Why does the help dialog not help? It tells you Cmder will start in a folder using the following command lines:

[

Cmder /start [start in folder]

|

Cmder [start in folder]

]

As you figured out in your last message by discovering '/start argument is optional', the help message tries to be helpful by already saying this. :-)

I am sure it could be made prettier but none of us are c++ wizards and at this time functionl but ugly is good enough.

The /start seemed unnecessary and redundant so it's not required but was left for backward compatibility.

What changes are you suggesting that would make it more helpful? Can you provide better wording?

Not working with a trailing '\"' is definitely unexpected and I will look at it.

@Pathduck
Copy link
Author

Pathduck commented Sep 2, 2018

As you figured out in your last message by discovering '/start argument is optional', the help message tries to be helpful by already saying this. :-)

Yeah - it kind of makes more sense now that I know about it. I just thought it looked really foggy. The old dialog seemed a lot better. Of course at the time I was struggling to just understand why the new version didn't seem to work at all with what I was giving it.

What changes are you suggesting that would make it more helpful? Can you provide better wording?

Well, the extra set of brackets outside makes it seem the OR applies to the whole /start argument (and that doesn't make much sense), I would suggest breaking it up into two lines. Or maybe like this:
[/start [Start in Path]] | [Start in Path]
or more readable
/start [Start in Path] | [Start in Path]
I.e. either of the options are valid.

Not working with a trailing '"' is definitely unexpected and I will look at it.

Thanks. Can't really ask for more than that 😄

Oh and I've found a workaround for Total Commander, as I can just leave the arguments blank, and TC will set the current working directory correctly. Not sure why, but it works - maybe it doesn't apply the trailing slash.

But of course it would be good if Cmder could handle trailing slashes like one would expect.

Cheers!

@Pathduck Pathduck changed the title 1.3.6: /start argument is no longer valid, what is the correct way to specify start directory? 1.3.6: Error on start path with trailing slash in quotes. Sep 2, 2018
@Pathduck
Copy link
Author

Pathduck commented Sep 2, 2018

Could be closed I guess, or it could wait until a fix is committed?

@daxgames
Copy link
Member

daxgames commented Sep 3, 2018

Leave it open its a big and it could take a while to fix it. I don't have a ton of time to dedicate to it and my c++ skills are not what they should be

@daxgames
Copy link
Member

daxgames commented Sep 3, 2018

Leave it open its a big and it could take a while to fix it. I don't have a ton of time to dedicate to it.

@daxgames
Copy link
Member

daxgames commented Sep 3, 2018

Fixed #1871

@daxgames daxgames closed this as completed Sep 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants