Chainsaw
unread,Dec 29, 2021, 2:51:42 PM12/29/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vim...@googlegroups.com
Hello,
I am using GVIM in Windows.
In a terminal window via ':terminal' (shell is cmd.exe), is there a way to return a string that is the actual dynamic current directory?
getcwd() and expand() always return the current working directory, which for ':terminal' is the path of cmd.exe, not the actual current directory in the terminal buffer/window.
Cmd.exe with command extensions enabled has access to the dynamic environment variable %CD%, but Vim does not appear to see the dynamic environment variables (unless there is a way).
What would be perfect is something like getenv('CD'), but somehow also target the buffer/window of a specific active terminal.
One use I have in mind is titlestring, so it needs to be efficient/fast.
Thanks,
Chainsaw