Wednesday, December 29, 2021

Get Terminal current directory for a specific window

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

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20211229143628.00002781%40cfl.rr.com.

No comments: