Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open new tab take lots of time on Hyper 2.1.0-canary.3 #58

Open
ohardy opened this issue Dec 12, 2018 · 6 comments
Open

Open new tab take lots of time on Hyper 2.1.0-canary.3 #58

ohardy opened this issue Dec 12, 2018 · 6 comments

Comments

@ohardy
Copy link

ohardy commented Dec 12, 2018

Hi,

Its take lots of time to open a new tab or split with the last canary version of Hyper.
No specific console log.

Any ideas ?

@marwankhalili
Copy link

This might be related to vercel/hyper#2838

@ohardy
Copy link
Author

ohardy commented Dec 13, 2018

Note sure. Everything was ok on canary 2 and if I disable hypercwd, I have no issue anymore

@hpohlmeyer
Copy link

hpohlmeyer commented Dec 18, 2018

Still the same with 2.1.0 stable for me.

@LeanderFS
Copy link

LeanderFS commented Jan 2, 2019

The problem is located in the setCwd function which contains an exec call to get the current working directory. In the current code it is assumed that exec returns a single string value but it actually returns 3 (error, stdout and stderr). The trim() called on the returned object therefore has no effect and fails to do so.

In the snippet below, promiseExec returns an object, so newCwd.trim() should actually be newCwd.stdout.trim().

const newCwd = await promiseExec(
    `lsof -p ${tab.pid} | grep cwd | tr -s ' ' | cut -d ' ' -f9-`);
  const cwd = newCwd.trim();

It doesn't seem like this repository is being actively maintained, so I decided to write a quick replacement plugin. It's located here hyper-samewd. Install with hyper i hyper-samewd

@ruucm
Copy link

ruucm commented Jan 3, 2019

@LeanderFS Thanks! I also changed the plugin to hypersamewd !

@MikuroXina
Copy link

The same thing happened.
I'd tried to use hyper-samewd, but it had not worked.
However, by rewriting the code of setCwd.js as following, somehow it worked well.

const newCwd = await promiseExec( // Specify LANG and not resolving domains
  `LANG=en_US.utf-8 lsof -n -p ${
    tab.pid
  } | grep cwd | tr -s ' ' | cut -d ' ' -f9-`
);

But it has not tested in various environments.
My environment is macOS 10.14.2, Hyper 2.1.1, Japanese.
Could you please test with other systems or languages?
(Maybe my english is not good because I'm Japanese, sorry.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants