Closed apopek closed 6 years ago
Sorry doesn't currently support Windows. Hyper 1.2.0 was expected to bring Windows support by setting CWD but it doesn't. There's still no efficient & consistent method to fetch CWD on Windows.
So please add this information in README.md that windows is not supported, thanks.
I'll look into adding it to Hyper myself through a PR ✌️
I'll leave this open until I either found a solution or added a disclaimer in readme.
According to https://github.com/zeit/hyper/pull/1412, the "cwd" was added to the redux session, on the 15th of January.
My guess is that it's available in current releases then?
@jnsn Sadly it doesn't do anything. Confirmed in the commit: https://github.com/zeit/hyper/commit/232295a195141810390113ff2d9e04efa737c4e3
I'm still looking to PR this myself but I've been really busy with work lately.
lsof -p {pid}
can be replaced with handle -p {pid}
for windows.
But there is a bug in Hyper: pid is always incorrect on windows. It's node-pty issue: https://github.com/Tyriar/node-pty/issues/67
@postromantic Hyper is now on 0.6.4 of node-pty. handle
is a Sysinternals tool and does not come with Windows, so not sure that helps? If yes, how would you use it?
@henrikdahl If you still want to implement it in Hyper, I think this is a good start https://github.com/zeit/hyper/issues/1357#issuecomment-288562100
@Stanzilla, thanks. i've tried to use handle
with latest version, but it's not as good as i expected.
The issues are:
handle
returns multiple file handles. for bash
it's ok (cause cwd is always first handle), but for cmd
it's random file handles so no way to pick the right one. powershell
doesn't expose cwd as file handle at allbash
on windows usually run with parent process (for instance, i'm using git-cmd.exe --command=/usr/bin/bash.exe) so you have to lookup for a child pid. it's quite easy, but very slow: wmic process where (ParentProcessId=${pid}) get ProcessId
So it doesn't work well. The right way is to track cwd in wintpy
, similar to ConEmu/ConsoleZ.
I'm using another approach now: set bash prompt to show cwd in title and subscribe to SESSION_SET_XTERM_TITLE
event to set current cwd in the hyper-statusline
. Hacky, but works well for me.
@postromantic do you have the code for that somewhere?
Waiting eagerly for this! hyper-statusline is so sexy, and I can get rid of cwd clutter in my terminal.
I've submitted a PR for my attempt to fix the issue on Windows. It is not 100% perfect but works good enough for me (I'm on Windows 7) - and better than the existing solution which doesn't work on Windows at all :-)
Wait, can't you easily get the CWD with the chdir
command?
You can but good luck trying to use that in a script. Getting it into a variable is not trivial.
Looks promising - how do we get that available?
In next release ✌️ #73
I'm working on Windows 8.1 I'm in directory with github .git folder and nothing showing, no error messages in console
Hyper 1.2.1