Page 1 of 1

Custom command line interpreter - current folder as argument

Posted: 06 Sep 2015 20:59
by Awpteamoose
I use Cmder as my cmd replacement of choice and I use -GuiMacro:0 print("<command>\n") to send commands to the currently active tab. However, I'd like to cd to the current folder first so I don't have to go like "!cd <path_to_folder> dir".
Is it currently possible?

Re: Custom command line interpreter - current folder as argu

Posted: 07 Sep 2015 11:51
by admin
The XY native variable

Code: Select all

<curpath>
resolves to the current path if run through the Address Bar. This might help.

Re: Custom command line interpreter - current folder as argu

Posted: 07 Sep 2015 13:00
by Awpteamoose
Well, I'd like to write !dir and have it be resolved to "cdd <curpath> && <command>" (cdd is my alias for change drive and directory)
Writing custom command line interpreter arguments like "-GuiMacro:0 print("cdd <curpath> && <command>\n")" doesn't work as <curpath> doesn't get resolved.

Going Alt+D, Home, "!cdd ", End, " && dir" is faster than replacing current path in the address bar with <curpath>.

Re: Custom command line interpreter - current folder as argu

Posted: 08 Sep 2015 20:49
by admin
I thought it would be resolved. But, well, command line interpreters is not my daily business. Hopefully somebody else reads this...

BTW, XY also has Aliases (and variables are resolved here). Check out the Help...

Re: Custom command line interpreter - current folder as argu

Posted: 09 Sep 2015 14:21
by Awpteamoose
admin wrote:BTW, XY also has Aliases (and variables are resolved here). Check out the Help...
I'm not sure how aliases would help me, can you go into more detail?

Basically what I'd like is another macro (like <command>) that would resolve to the currently active tab's folder. I suppose this is more of a feature request, unless I'm misunderstanding something obvious.

Re: Custom command line interpreter - current folder as argu

Posted: 10 Sep 2015 15:29
by admin
OK, thanks, I think now I got it. I will add something to the next beta...