sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
804 stars 39 forks source link

Sublime Text 3 Build 3211 OSX 10.14.6 not correctly starting via `subl .` / Endless Recursion #3147

Open tilo opened 4 years ago

tilo commented 4 years ago

Description

Steps to reproduce

1a Remove old Sublime Text 3 installation (move to trash) 1b Remove old Sublime configuration (rename /Library/Application Support/Sublime Text 3 folder) 1c remove the subl sym-link in /usr/local/bin 2a Install latest Sublime Text 3 build #3211 2b re-link ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

  1. launch Sublime manually by clicking the icon (first launch), then exit Sublime
  2. go to project directory and launch sublime via subl .

Expected behavior

  1. subl . should: a. find a running Sublime instance or launch a new one b. open a window showing the code tree for the current directory c. exit

Actual behavior

  1. subl . hangs, does not exit 👎

  2. a new Sublime window opens, but it is completely empty 👎

3 a. when that Sublime window gets closed via the red menu button, another one appears immediately 💣

3 b. when the user closes Sublime via the Apple menu: Sublime Text 3 > Quit Sublime Text 3 Sublime does an endless recursion opening up windows - until the OS is overwhelmed and reboots 💣💥💥💥💥💥

How could this ever have passed QA on OSX?

Environment

wbond commented 4 years ago

It sounds to me like something atypical is going on with your machine. What folder were you in when you called subl .? Was it an extremely large folder, or a remote mounted filesystem?

I have never heard of 3a or 3b happening, ever.

Are you positive this is with a fresh install and no plugins? Just to be clear, in 1b you meant ~/Library/Application Support/Sublime Text 3, right?

TerminalFi commented 4 years ago

Description

  • subl . not opening the current directory tree in the editor
  • subl . hanging
  • endless recursion if that Sublime window is closed via menu: Sublime > Quit Sublime Text 3

Steps to reproduce

1a Remove old Sublime Text 3 installation (move to trash) 1b Remove old Sublime configuration (rename /Library/Application Support/Sublime Text 3 folder) 1c remove the subl sym-link in /usr/local/bin 2a Install latest Sublime Text 3 build #3211 2b re-link ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

  1. launch Sublime manually by clicking the icon (first launch), then exit Sublime
  2. go to project directory and launch sublime via subl .

Expected behavior

  1. subl . should: a. find a running Sublime instance or launch a new one b. open a window showing the code tree for the current directory c. exit

Actual behavior

  1. subl . hangs, does not exit 👎
  2. a new Sublime window opens, but it is completely empty 👎

3 a. when that Sublime window gets closed via the red menu button, another one appears immediately 💣

3 b. when the user closes Sublime via the Apple menu: Sublime Text 3 > Quit Sublime Text 3 Sublime does an endless recursion opening up windows - until the OS is overwhelmed and reboots 💣💥💥💥💥💥

How could this ever have passed QA on OSX?

Environment

  • OSX 1014.6
  • Sublime 3 Build 3211

I've not been able to reproduce this under the same OSX version and Sublime version. @tilo can you confirm this is still happening? And give and update to the above questions.

silverzhaojr commented 4 years ago

I have met such issue in my env, and I seemed to find the workaround.

My env is MacOS 10.15.3, Sublime Text Build 3211.

Here is the reproduce step:

  1. open Terminal.app;

  2. open tmux in terminal;

  3. run subl . in tmux, it shoud be successful.

  4. logout the user;

  5. login again;

  6. open Terminal.app;

  7. Use tmux attach to attach the existing tmux session started before;

  8. run subl . in tmux, it will fail as the poster described: subl hangs, new Sublime Text window opens with empty content.

My workround:

  1. If you run subl . outside of tmux, it will be successful, like: open a new Terminal.app and run subl .;
  2. Or terminate the last tmux session, and start a new one, then subl . in tmux will also be successful.

Possible root cause: It looks like logout/re-login resets some user session setting. It may have something to do with "tmux reattach-to-user-namespace", but I'm not sure about that. Hope someone more expert can dig into the issue.

timotheecour4 commented 2 years ago

I had hit this bug some time back and ended up having to reboot; I just hit this bug again today and found this, https://github.com/sublimehq/sublime_text/issues/3147#issuecomment-590434482 nailed the explanation!

This can happen for variety of reasons, and is very perplexing when it happens. I also suspect it has to do with reattach-to-user-namespace