2

If I type open $(pwd) or open /anypath/ I will get the path opened in Finder. How I can achieve similar results but with the path opening in Double Commander instead?

3

By default Double Commander is programmed to open with two Tabs each set to the current location of the Double Commander.app application bundle. If one then changes to a different location other then the default on one of the Tabs and then closes Double Commander and reopens it, it opens to the last location before being closed.

Here's a way to open Double Commander to a specific path from the command line similar to opening Finder to a specific path using Terminal. This covers the default of two Tabs.

Use the following syntax in a Terminal:

open -a Double\ Commander --args -path location ...

Example:

open -a Double\ Commander --args -path ~/Documents

This will open Double Commander to your Documents folder in the left Tab and the right Tab will open to the last location opened.

If you want to set the location of the both Tabs use:

open -a Double\ Commander --args -path location location

Example:

open -a Double\ Commander --args -path / ~/Documents 

This will open Double Commander to the root of the boot volume, typically Macintosh HD, in the left Tab and your Documents folder in the right Tab.

If there is a way to set just the right Tab while letting the left Tab default to the last saved location I do not know the syntax for it, if it's even doable. I did try several attempts using different delimiters but none gave the wanted results in testing.


Update to address the comment by s.newave:

I'd add a function to your .bash_profile file as in the following example code:

function odc () {
        pkill doublecmd; open -a Double\ Commander --args --no-splash -path "$1" "$2"
 }

Then from the command line in Terminal you can simply use odc or e.g.: odc / ~Documents

Note that if the Double Commander > Configuration > Behaviors > [] Allow only one copy of DC at a time, check box is not checked, you can use the following variant to open a new occurrence of Double Commander to the desired paths leaving other occurrences of Double Commander running.

function ondc () {
        open -n -a Double\ Commander --args --no-splash -path "$1" "$2"
 }

Then from the command line in Terminal you can simply use ondc or e.g.: ondc / ~Documents

Note that in either case you can also pass a single argument as well, e.g. odc ~Documents or: ondc ~Documents

The function names odc and ondc stand for open double commander and open new double commander, respectively.

  • is there a way to make this work if Double Commander is already open? Using the same command doesn’t seem to work. – s.newave Mar 24 '18 at 0:15
  • @s.newave, See updated answer to address your comment. Note that you can use the commands shown within the two functions by themselves on the command line, they do not need to be used as functions however it makes more sense to do so. – user3439894 Mar 24 '18 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .