Fixes issue getting win32 current working directory #53
Conversation
Refactored to try to get windows current working directory using regex as lsof not available in win32. Not 100% accurate, but better than no support at all. Updated to support multiple tabs and splitting of windows.
Nice! |
This is working great for me on windows 10 v1607 - thanks @dougd! |
This is neat! I'm gonna try this out later today. Thanks for your contribution and sorry for the massive delay ✌️ |
I noticed this only starts working after you sent your first command to the terminal, before that the statusbar stays blank |
Ah true - I see this as well @Stanzilla - didn't notice because I'd usually cd into somewhere first. Now I'm using hypercwd (windows PR) I see it on a new tab though. |
You're talking about this one here, right? hharnisc/hypercwd#21 Looks like a similar approach to the one by @dougd |
Yep - that's what I'm using as a local plugin. |
@dougd are you on win10 btw? |
On Win7. Does it not work on Win10?
Cheers,
Doug
…
On Sep 26, 2017 at 2:22 pm, <Benjamin Staneck ***@***.***)> wrote:
@dougd (https://github.com/dougd) are you on win10 btw?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#53 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/AB6dsVEzsNu3bvPhelxD5NY7-0cQezFIks5smPp9gaJpZM4Nqxed).
|
No I just thought about the fact that Win10 has the Linux Subsystem and you could use that instead of a regex. I just started playing around with it and const setCwd = (pid) => {
exec(`bash.exe -c lsof -p ${pid} | awk '$4=="cwd"' | tr -s ' ' | cut -d ' ' -f9-`, (err, stdout) => {
cwd = stdout.trim();
setGit(cwd);
});
}; resulted in https://i.imgur.com/h2L6aE0.png 😄 |
Ah I see 👍 would we want different code path for win7 and win10? I suppose we already have windows, mac and linux :-)
Cheers,
Doug
…
On Sep 26, 2017 at 2:29 pm, <Benjamin Staneck ***@***.***)> wrote:
No I just thought about the fact that Win10 has the Linux Subsystem and you could use that instead of a regex. I just started playing around with it and
const setCwd = (pid) => { exec(`bash.exe -c lsof -p ${pid} | awk '$4=="cwd"' | tr -s ' ' | cut -d ' ' -f9-`, (err, stdout) => { cwd = stdout.trim(); setGit(cwd); }); };
resulted in https://i.imgur.com/h2L6aE0.png 😄
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#53 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/AB6dsYK8gIlYSZmtSHzfIQpQsTCak0rNks5smPw4gaJpZM4Nqxed).
|
Depends on performance and if I get it working, I guess. If your solution is faster than going to bash on Windows then it's not worth it to make a special path. |
Your solution if it flies would yield more reliable results....
Cheers,
Doug
…
On Sep 26, 2017 at 2:34 pm, <Benjamin Staneck ***@***.***)> wrote:
Depends on performance and if I get it working, I guess. If your solution is faster than going to bash on Windows then it's not worth it to make a special path.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#53 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/AB6dsVOz-fakJw8SZRzctW-7tW7jcenOks5smP1RgaJpZM4Nqxed).
|
Looks like the plugin as moved on since I did this work, closing and there is another pending PR to address this. |
Resubmitted PR due to issues with previous one and tabs. Refactored to try to get windows current working directory using regex as lsof not available in win32. Not 100% accurate, but better than no
support at all. Needs tested on mac and linux.