Page 1 of 1

Getting the Retrieving Current Working Directory Absolute Path

Posted: 10 May 2025 01:50
by twosixfoursix
Hi there,

I hope this finds you well. I was wondering, is there a way we are able to get specifically the current working directory path & run a user defined command by passing that as argument? I seem to only be able to pass selected files paths within a folder - not the folder itself.

Currently, I am having to accomplish this via terrible code in the form of a proxy program that:
    1. Acts on any selected file and gets only the first file form arguments.
    2. Checks if it is a directory or actual file. If file, then retrieves its containing folder.
    3. Starts up a windows process using that gnarly Win32 API function.

I was hoping you could offer some solution to this issue so I could avoid the unsafe/poorly-written code just to open Windows Terminal at the current directory I am at...

The issue is that I am running Windows 10 & have disabled some OS features due to which I am unable to "set" my official Command Prompt exe to anything other than cmd.exe or powershell.exe - I run a portable mode of Windows Terminal for my CLI tasks. I did go through the site and help to see if this was possible, but wasn't able to find what I was looking for. I would greatly appreciate any suggestions/follow-up regarding the matter.

Thank you kindly,
Amin

Re: Getting the Retrieving Current Working Directory Absolute Path

Posted: 10 May 2025 07:06
by highend
<curpath> contains the current path of the active list pane

So e.g.:

Code: Select all

$wt = "{path to your portable windows terminal ...}\wt.exe";
    run """$wt"" new-tab -d ""<curpath>""";

Re: Getting the Retrieving Current Working Directory Absolute Path

Posted: 11 May 2025 04:07
by twosixfoursix
Absolutely amazing! Worked like a charm, much appreciated!