Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Test on Windows #3

Open
LeanderFS opened this issue Jan 10, 2019 · 4 comments
Open

Test on Windows #3

LeanderFS opened this issue Jan 10, 2019 · 4 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@LeanderFS
Copy link
Owner

I'm looking for someone who has access to a Windows device that can test the workings of the plugin.

@LeanderFS LeanderFS added help wanted Extra attention is needed good first issue Good for newcomers labels Jan 10, 2019
@zikaari
Copy link

zikaari commented Jan 12, 2019

I'm a win32 user and author of pid-cwd

Awesome plugin, and works neatly with default Hyper setup. That is, as long as user continues to use cmd.exe as the shell.

But...

Most users on win32 switch to git for windows (not to be confused with bash on windows powered by Ubuntu subsystem on Windows). The problem with this is that Hyper will spawn git for windows inside it and session.pid will point to that process. However git for windows in turn spawns a child shell (with its own pid) that unfortunately happens to be the source of truth.

Whenever user does cd x/y/z, that doesn't change the cwd of git for windows process (the one that hyper.store.session.pid is pointing at), instead the child shell of git for windows that hyper is unaware of.

IMO, when shell is git for windows, it is best if we don't ask pid-cwd, but instead parse the window title instead.

Here's what session object looks like in that case:

{
  // ...
  shell: "C:\Program Files\Git\git-cmd.exe"
  title: "MINGW64:/c/Users/neeksandhu/Dropbox/projects/react-aspen"
}

@zikaari
Copy link

zikaari commented Jan 12, 2019

Now, two other cases:

1. When user is using Bash for Window (powered by Ubuntu subsystem on Windows)

This one I think is just off-limits. When this setup is being used, hyper spawns a "proxy" shell that runs inside host OS (windows). That "proxy" shell points at a very minimal ubuntu shell running inside a literal virtual machine. The session.pid points at that "proxy" shell, however the real pid of what user sees is actually another process in a virtual machine. Pure inception, that is.

I personally don't (and never will) use this setup, considering how "disconnected" this is from my host OS (where all of my stuff lives)

2. Powershell

Just pathetic. Doing pidCwd on pid of the actual Powershell process won't return the "current" working directory, but the directory it was started in. However, running pidCwd on processes that are started from that very shell will never lie.

@LeanderFS
Copy link
Owner Author

@NeekSandhu Thanks a lot for the input, i'm going to deep dive into this to try and resolve the issues

@LeanderFS LeanderFS self-assigned this Jan 15, 2019
@bwiercinski
Copy link
Contributor

bwiercinski commented Jan 31, 2019

as a zsh user under cygwin on windows 10:
this plugin works brilliant. Hypercwd didn't work because cygwin paths are competent to understand. /cygdrive/d/folder1/folder2 should bind to D:\folder1\folder2 and /usr to C:\cygwin64\usr. now I have properly working hyper terminal!

Great work @LeanderFS @NeekSandhu

Edit:
My config

shell: 'C:\\cygwin64\\bin\\zsh.exe',
shellArgs: [] // it's important not to add "--login" or "-l" parameter

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants