Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Fixes issue getting win32 current working directory #53

Closed
wants to merge 1 commit into from
Closed

Fixes issue getting win32 current working directory #53

wants to merge 1 commit into from

Conversation

dougd
Copy link

@dougd dougd commented May 30, 2017

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.

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.
@dougd dougd mentioned this pull request May 30, 2017
@Stanzilla
Copy link

Nice!

@haustraliaer
Copy link

This is working great for me on windows 10 v1607 - thanks @dougd!

@henrikruscon
Copy link
Owner

This is neat! I'm gonna try this out later today. Thanks for your contribution and sorry for the massive delay ✌️

@Stanzilla
Copy link

I noticed this only starts working after you sent your first command to the terminal, before that the statusbar stays blank

@haustraliaer
Copy link

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.

@Stanzilla
Copy link

Stanzilla commented Aug 8, 2017

You're talking about this one here, right? hharnisc/hypercwd#21 Looks like a similar approach to the one by @dougd

@haustraliaer
Copy link

Yep - that's what I'm using as a local plugin.

@Stanzilla
Copy link

@dougd are you on win10 btw?

@dougd
Copy link
Author

dougd commented Sep 26, 2017 via email

@Stanzilla
Copy link

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 😄

@dougd
Copy link
Author

dougd commented Sep 26, 2017 via email

@Stanzilla
Copy link

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.

@dougd
Copy link
Author

dougd commented Sep 26, 2017 via email

@dougd
Copy link
Author

dougd commented Mar 16, 2018

Looks like the plugin as moved on since I did this work, closing and there is another pending PR to address this.

@dougd dougd closed this Mar 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants