sublimehq/sublime_text

CMD-P freezes when I search within my directory of 121K files

Closed this issue · 11 comments

Description of the bug

Sublime v 4180 when I have my work directory open which has ~20 directories on root but contains probably 121K files or so and I run CMD-P to open a file based on filename, it sometimes freezes and a circle spins and sometimes it continues. I have to force quit and reopen and try again and sometimes it works on 2nd try. Very annoying as I love to open up files and navigate with CMD-P. This has always been the situation with my big work directory.

Steps to reproduce

  1. Open sublime
  2. Open my work directory containing ~20 dirs all total containing 121K files
  3. Search for my files to open with CMD-P.
    Filename examples (not exact):
    • Cheatsheet.txt
    • Weekly Report 2024-10-11.txt
  4. It either freezes (cursor circle spins) or show box. When freezes and I force quit mac provided some extra dumps which I included below.

Expected behavior

Not freeze and not error

Actual behavior

Shows error or freeze and I have to force quit and repeat and hopefully it doesnt exit on 2nd time.
This error has been happening more consistently I suspect because I have more files in my work dir now.

Here is the error:

Sublime Text 2024-10-10 16 57 04

And another:

Sublime Text 2024-10-10 16 58 27

Sublime Text build number

4180

Operating system & version

MacOS 15.0.1

(Linux) Desktop environment and/or window manager

No response

Additional information

MacBook Pro 16inch 2019 Intel

MAC provided this bug report - attached:
sublime-exit-on-cmd-p-2024-10-10.txt

OpenGL context information

No response

Note: when the error box appears, I just close it and I can continue and retry. However when it freezes with the circle spinner. I have to force quit and retry from scratch.

Does it happen in safe mode?

Will try and get back to you. This is my other account. Bhbmaster & kostia-lb

Just tried Sublime with Safe-Mode by holding the Option key.
The search feature seems to work. I am able to look up anything and scroll seamlessly and quickly thru the results.
No freezes and no error boxes. However my new files open as tabs and I don't see their entries on the left side bar. I assume that is some extension providing that functionality.

Ignore the empty file just opened it so work stuff isn't revealed.

Here is a screenshot:

image

Considering that the freeze isn't happening in safe mode it's most likely a plugin that's causing the freeze. I suggest systematically disabling your plugins until you find the culprit.

However my new files open as tabs and I don't see their entries on the left side bar. I assume that is some extension providing that functionality.

This is simply done through View > Side Bar > Show Open Files.

I will investigate. If it's a plugin issue, I suppose best next action would be to reach out to the dev 9f plugin?
I reckon we can close this ticket or keep it open until I find the culprit?

However my new files open as tabs and I don't see their entries on the left side bar.

If installed, SyncedSidebar package might be a candidate, if it tries to reveal each previewd file in sidebar automatically - just a guess.

Maybe also Anaconda, if it is starting expensive tasks for each previewed file. Plugins should generally keep quiet for transient views.

---Quick Question:---

Does the Anaconda package have any relation to the core Sublime Text installation? I assume it doesn't. In the screenshots from the original message, I noticed "Anaconda" in the box, which might indicate it as the culprit. I went ahead and deleted it, though I wasn’t sure of the exact steps.

---Finding Anaconda and Deleting it:---

Additionally, I’ve noticed my Package Control is missing when I run CMD-SHIFT-P (this is from regular mode, not safe mode).

image

I located the directory where Sublime Text stores some of its Installed packages: /Users/kostia/Library/Application Support/Sublime Text 3/Installed Packages

I didn't see Anaconda in the Installed Packages directory, but I found it under:
/Users/kostia/Library/Application Support/Sublime Text 3/Packages.

I backed up the Sublime Text 3 directory, deleted the Anaconda directory from Packages, and removed the Anaconda.sublime-settings file from Packages/User.

---Good news:---

  • After deleting the Anaconda package, the crashes are less frequent, and the Anaconda-related issue seems resolved.

---Bad news:---

  • I still encountered a crash with the spinning beachball (couldn’t capture a screenshot, but it looked similar to this image):
image

When I force quit, macOS prompts a bug report, which I submitted with a comment linking this issue. It also generated a stack trace:

sublime-exit-on-cmd-p-2024-10-11-post-delete-anaconda.txt

---Notes From Testing:---

  • I used CMD-P and typed in frequent terms like "cheatsheet" and "weekly report."
  • I also tried scrolling quickly through the results with "a" to simulate frequent usage, which eventually caused the crash.
  • In safe mode, no crashes occur.
  • Although crashes are less frequent after removing Anaconda, they still happen occasionally.

May I should just do a full delete and fresh install of Sublime. How does one fully purge sublime and its settings from the system?
Then I supposed I will reinstall the package manager, followed by some of the extensions that are important for me. Ill have to make sure to remember (any tips to get a list of those will be good; I suppose the directory I backed up might have those answers).

Update: I am doing a fresh install

I had the infamous Package Install Issue.

So I reran these steps and it works now

Delete Sublime from my Applications folder on MAC

# Verify Sublime things

ls -l ~/Library/Application\ Support/Sublime\ Tex*
ls -l ~/Library/Preferences/com.sublimetext.*
ls -l ~/Library/Caches/com.sublimetext.*
ls -l ~/Library/Saved\ Application\ State/com.sublimetext.*

# Delete Sublime things

rm -vrf ~/Library/Application\ Support/Sublime\ Tex*
rm -vrf ~/Library/Preferences/com.sublimetext.*
rm -vrf ~/Library/Caches/com.sublimetext.*
rm -vrf ~/Library/Saved\ Application\ State/com.sublimetext.*

Install the older openssl. Without the @1.1 it installs version 3.

brew install openssl@1.1
brew link openssl@1.1                                            # this errored for me because I have openssl 3 installed accidentally 

# you dont need to run these 2 commands if above did not error
brew link --overwrite openssl@1.1 --dry-run      # see what files it will change. nothing major
brew link --overwrite openssl@1.1                        # do the change

Then install Sublime.

View --> console

Then start it and install Package Control. CMD-SHIFT-P --> Install Package --> enter

No errors this time.

Now I will one by one install the packages and see where it messes up.

Then I reconfigured everything to my liking.

I didnt install all of my packages, but the most important ones to me

Here is the plugins / packages, I started my fresh Sublime Text 4180 with on 2024-10-11 on MacOS 15.0.1 (2019 Intel)

  • Package Control ✅
  • Cola theme ✅
  • Bracket highlighter ✅
  • Git ✅
  • Rainbow_csv ✅
  • SidebarEnhancements ✅
  • TrailingSpaces ✅
  • MaxPane - Controk-k control-f (similar to tmux zoom) ✅
  • Origami - Pane control ✅

I then restored 3 settings files manually in the main user preferences directory:

❯ pwd
/Users/kostia/Library/Application Support/Sublime Text/Packages/User

❯ ls -l
total 16
-rw-r--r-- 1 kostia staff 126 Oct 11 16:27 'Default (OSX).sublime-keymap'
-rw-r--r-- 1 kostia staff 248 Oct 11 16:29 'Package Control.sublime-settings'
-rw-r--r-- 1 kostia staff   0 Oct 11 16:16 'Package Control.user-ca-bundle'
-rw-r--r-- 1 kostia staff 354 Oct 11 16:29  Preferences.sublime-settings
-rw-r--r-- 1 kostia staff  33 Oct 11 16:28  reStructuredText.sublime-settings

❯ tail -n 10000 'Default (OSX).sublime-keymap' Preferences.sublime-settings reStructuredText.sublime-settings

==> Default (OSX).sublime-keymap <==
[
{ "keys": ["ctrl+d"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} }
]

==> Preferences.sublime-settings <==
{
"color_scheme": "Mariana.sublime-color-scheme",
"font_face": "Firacode Nerd Font Medium",
"font_size": 18,
"ignored_packages":
[
"Vintage",
],
"theme": "Cola.sublime-theme",
"word_wrap": true,
"auto_complete_commit_on_tab": true,
"dark_color_scheme": "Sixteen.sublime-color-scheme",
"light_color_scheme": "Mariana.sublime-color-scheme",
}

==> reStructuredText.sublime-settings <==
{
"extensions":
[
"txt"
]
}

I tested CMD-P search and it works like a charm!

Final Words

I think we are good to go. I am closing this ticket.
Thanks for everyones Help