sublimehq / sublime_text

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

"Save"/"Save as" dialog cannot handle folders with macOS Finder Tags #6319

Open htmue opened 8 months ago

htmue commented 8 months ago

Description of the bug

When saving a new file into a folder with folders with tags on the path, instead of using the virtual working directory, the dialog opens with another folder higher up in the path.

Steps to reproduce

  1. create a test project with nested folders, for example mkdir -p finder-tags/without-tag/with-tag/nested
  2. add a tag to the with-tag folder using macOS Finder
  3. open ST subl --safe-mode finder-tags
  4. to get defined starting conditions, context-click on the finder-tags folder in the sidebar and select New File
  5. press Cmd-S and save the file to the finder-tags folder
  6. context-click on the nested folder and select New File
  7. press Cmd-S

Expected behavior

Save dialog opens with the nested folder selected.

Actual behavior

Save dialog opens with the without-tag folder selected.

Sublime Text build number

4169

Operating system & version

macOS 13.6.4 (it also happened with earlier versions)

(Linux) Desktop environment and/or window manager

No response

Additional information

macOS Finder uses extended attributes to save tags, listed with ls -l@. Example attributes for a red tag:

 com.apple.FinderInfo    32 
 com.apple.metadata:_kMDItemUserTags     50 

When removing the tag, only the com.apple.FinderInfo attribute is removed. Then the save dialog works properly again.

OpenGL context information

No response

BenjaminSchaaf commented 8 months ago

Does this only happen with ST or are you seeing the same behavior in other apps?