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

Created on 26 Aug 2018  路  9Comments  路  Source: cmderdev/cmder

Purpose of the issue

  • [x] Bug report (encountered problems/errors)
  • [x] 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"

Most helpful comment

Fixed #1871

All 9 comments

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

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

@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...

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.

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!

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

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

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.

Fixed #1871

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AaronKaa picture AaronKaa  路  3Comments

bmeverett picture bmeverett  路  3Comments

zsedcbm picture zsedcbm  路  3Comments

tfarina picture tfarina  路  3Comments

giuliannosbrugnera picture giuliannosbrugnera  路  3Comments