-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Initial hyper session is not created correctly #3770
Comments
@chabou Friendly ping :) Can you please take a look at this? It's a really annoying issue :/ Thanks! |
Any progress? |
I would like to bump this issue as well. I also find this issue to be annoying when using |
Any of you want to create PR for this? |
Happy to do so. Will create a PR with the suggested solution I outlined in my initial analysis of this problem :) |
Update: Sorry, I thought I'd have the resources to do this, but unfortunately currently I don't. Happy if someone else would like to come up with a PR. |
@Stanzilla @stnwk Done: #3937 |
Issue
Hi :) Thanks for your work on this!
I use https://github.com/hharnisc/hypercwd and noticed the following bug hharnisc/hypercwd#71:
The problem is:
The initial working directory is not set correctly for the very first hyper session, but people noticed that after a full reload the CWD was set correctly again. The issue on
hypercwd
seems a bit stale and nobody seems to know how to fix it, so I took a little dive into the code and this is what I found:First: the bug does not seem to come from the
hypercwd
codebase, but rather from this codebase.The problem seems to be located in the optimistically/eagerly creating an initial session here: https://github.com/zeit/hyper/blob/c13c8a5c52cbc8e02098244193a4e715fffcd902/app/ui/window.js#L140
To be more exact in
createInitialSession()
:https://github.com/zeit/hyper/blob/c13c8a5c52cbc8e02098244193a4e715fffcd902/app/ui/window.js#L124
Here
createSession()
is optimistically called without passing any parameter, although the function is defined ascreateSession(extraOptions = {})
. ThoseextraOptions
are used to set theCWD
(among other things correctly), see: https://github.com/zeit/hyper/blob/c13c8a5c52cbc8e02098244193a4e715fffcd902/app/ui/window.js#L111This optimistically creating an initial session without passing the correct
extraOptions
is the underlying problem for the mentioned issue. The CWD is set incorrectly, because it is not set at all. After a full reload however it is then overwritten correctly.I am unsure about the reasoning for this optimistic session creating and whether it is a technical necessity or a performance optimization.
I tried removing https://github.com/zeit/hyper/blob/canary/app/ui/window.js#L140 this line and everything seemed to still work and the bug was fixed.
I hope this analysis provides enough insight for you to come up with a decision on how to proceed quickly as the issue really is quite annoying.
Thanks for your help, have a nice day :)
The text was updated successfully, but these errors were encountered: