cm_copySrcPathToClip with trailing backslash

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Jesco
Junior Member
Junior Member
Posts: 65
Joined: 2003-12-05, 17:28 UTC

cm_copySrcPathToClip with trailing backslash

Post by *Jesco »

Hello,

there are a couple of commands for copying paths and file names to the clipboard. Very frequently I need the current path in the clipboard to use it in the 'Save As'-dialog of some other program.

'cm_copySrcPathToClip' is provided for that purpose, unfortunatly it is necessary to manually add a trailing backslash). I therefore used Lst2Clip that provides copying with trailing backslash, but now I use TotalCmd also in an environment that does not allow me to use that external program.

My suggestion is that cm_copySrcPathToClip (and cm_CopyTrgPathToClip to keep it consistent) adds a trailing backslash by default (or that additional built-in commands would be available with that functionality).

As the other commands like cm_AddPathToCmdline or <Ctrl p> add a trailing backslash I do not see the reason why cm_copySrcPathToClip does not. BTW, the current behaviour also is inconsistent as a backslash is added for the root directory (C:\ instead of C:).

Cheers,
Jesco
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

C:\ and C: are different paths while C:\ABC\ and C:\ABC aren't.
User avatar
Hacker
Moderator
Moderator
Posts: 13144
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Jesco
Junior Member
Junior Member
Posts: 65
Joined: 2003-12-05, 17:28 UTC

Post by *Jesco »

C:\ and C: are different paths
OK, so that makes sense.

@Hacker: thanks for that link. However, my main point was to support the functionality as a built-in command as I use TotalCmd on computers where I am not allowed to install additional software. Copying paths is such a basic functionality that I think also the flavour with trailing backslash could be implemented in the program itself.

Cheers,
Jesco
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Many software doesn't require installation, you can simply unpack it and use everywhere. E.g. you can simply put Lst2Clip executable to TC dir and call it in a user-command via environment variable %COMMANDER_PATH%.

BTW C: w/o backslash in DOS/Windows specifies current directory on C:\ drive. It even works in TC: enter e.g. C:\Windows, then switch to another drive and execute command cd C:. You will return back to C:\Windows.
Jesco
Junior Member
Junior Member
Posts: 65
Joined: 2003-12-05, 17:28 UTC

Post by *Jesco »

Many software doesn't require installation
Yes, but in my case executing programs other than preinstalled is forbidden by policy rather than technically impossible.
C: w/o backslash in DOS/Windows specifies current directory
Yes, agreed.

It would still be more consistent if a backslash would be appended in any case when executing cm_copySrcPathToClip. It is probably the functionality I use most in TotalCmd: in any 'Save As' dialog of any software rather than navigating within the dialog by mouse I prefer to navigate to the target directory using TotalCmd and then copy and paste the path in front of the filename - it's annoying to manually append a \ every time.

Cheers,
Jesco
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

What a strange policy:) do they check _every_ executable you start? Even TC dir contains many EXEs that TC may use...

Also I don't understand why do you need to append trailing backslash to path in 'Save as' dialog. You can easilly paste path w/o it and press Enter - dialog will open that directory and then you will be able to enter filename. Or you type filename w/o entering directory?

It is really interesting BTW why TC adds trailing backslash when I copy dir path using cm_CopyFullNamesToClip but strips it when using cm_CopySrcPathToClip.
Jesco
Junior Member
Junior Member
Posts: 65
Joined: 2003-12-05, 17:28 UTC

Post by *Jesco »

Also I don't understand why do you need to append trailing backslash to path in 'Save as' dialog.
Well, always when a filename is already suggested in the dialog - which is the case most of the time.
Jesco
Junior Member
Junior Member
Posts: 65
Joined: 2003-12-05, 17:28 UTC

cm_copySrcPathToClip with trailing backslash

Post by *Jesco »

Hello,

now that the new program version approaches its release date I want to ask for my suggestion again: add a trailing backslash to output of command cm_copySrcPathToClip. Is there a chance that this behavior will be changed or is there any good reason that the backslash is missing?

Cheers
Jesco
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

I'm not sure I see the problem. Explorer's Open/Save dialog treats the following as the same (after Enter is pressed)

c:\TestDir\SubDir
c:\TestDir\SubDir\

Both open to C:\TestDir\SubDir ...

Although when the "\" slash is present it's messier as a drop-down occurs to choose other subfolders or files within that path.

Also not including the trailing slash is standard among pretty much any program that splits a full path into it's respective parts - even AHK and CMD Batch. Granted it may not make entirely logical sense, since when you split something like
C:\TestDir\SubDir\TestFile.txt -->
PATH: C:\TestDir\SubDir
FILE: TestFile.txt

You have to manually add the seperator back when concatenating the string back together.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
Jesco
Junior Member
Junior Member
Posts: 65
Joined: 2003-12-05, 17:28 UTC

Post by *Jesco »

Hello,

I explained the reason for my suggestion in the first post (and subsequent ones): (a) some program presents me a 'File Save'-dialog, (b) the target directory is already open in Total Commander, (c) instead of clicking through the folder tree in the dialog, I copy the path from Total Commander and paste it in front of the file name => but I always have to add an additional backslash.

Cheers
Jesco
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Sorry but we don't understand why can't you press Enter after pasting path to filename field of Save dialog in order to open that path and then simply enter just filename w/o path.
Jesco
Junior Member
Junior Member
Posts: 65
Joined: 2003-12-05, 17:28 UTC

Post by *Jesco »

MVV wrote:Sorry but we don't understand why can't you press Enter after pasting path to filename field of Save dialog in order to open that path and then simply enter just filename w/o path.
Because the filename is already filled in for most of these dialogs, I would loose that name using the steps you proposed.
User avatar
HolgerK
Power Member
Power Member
Posts: 5412
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Workaround:
Inside "File Save As Dialog" press <F4>; paste your path; <Enter>; <Enter>

Regards
Holger
Jesco
Junior Member
Junior Member
Posts: 65
Joined: 2003-12-05, 17:28 UTC

Post by *Jesco »

HolgerK wrote:Workaround: Inside "File Save As Dialog" press <F4>; paste your path; <Enter>; <Enter>
That will work in only a few dialogs.

I think the better 'workaround' would be to just add a backslash by default. But sadly so far no response from the author ..
Post Reply