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

[CLOSED] Fix MacOS folder icon handling. Fixes #12789 #10908

Open
core-ai-bot opened this issue Aug 30, 2021 · 6 comments
Open

[CLOSED] Fix MacOS folder icon handling. Fixes #12789 #10908

core-ai-bot opened this issue Aug 30, 2021 · 6 comments

Comments

@core-ai-bot
Copy link
Member

Issue by petetnt
Thursday Sep 29, 2016 at 19:06 GMT
Originally opened as adobe/brackets#12807


This PR handles an rare edge case where MacOS folder icon breaks down the whole FileTreeView. For repro steps see #12789

Background from superuser.com:

What is it?

It's name is actually Icon\r, with \r being the carriage return 0x0D. If letting the shell autocomplete the path in Terminal, it yields Icon^M, ^M being \r.

Icon^M is a file existing in all directories that have a custom icon in Finder. If you change a directory's icon e.g. in its Get Info dialog by pasting an image into the icon in the upper left corner, the Icon^M file is created.

This PR checks for the existence of an file called Icon\r, and bails out of rendering the said fileNode if it's name matches it. This is relatively safe, because you shouldn't be able to create filenames with such special characters yourself.

There's an side effect of failing to create a file called "Icon" if Icon\r already exists in the same folder, but the behaviour matches MacOS Finder, which also fails (silently).

The PR includes adds Icon\r to the default exclusion list


petetnt included the following code: https://github.com/adobe/brackets/pull/12807/commits

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Thursday Sep 29, 2016 at 19:22 GMT


If you change instead ProjectModel._shouldShowName would still work?
Since there is already a mechanism to hide elements from the file tree I think is better to change that.

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Thursday Sep 29, 2016 at 19:37 GMT


@ficristo Sadly I tried it with

var _exclusionListRegEx = /\.pyc$|^\.git$|^\.gitmodules$|^\.svn$|^\.DS_Store$|^Icon\\r$|^Thumbs\.db$|^\.hg$|^CVS$|^\.hgtags$|^\.idea$|^\.c9revisions$|^\.SyncArchive$|^\.SyncID$|^\.SyncIgnore$|\~$/;

But the regexp doesn't catch it for some reason (tried it with the m flag too). Works just fine on RegExp101: https://regex101.com/r/pLbOJH/1

If you have any ideas on how to get it working, I'd totally be into changing the check to that 👍

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Thursday Sep 29, 2016 at 19:42 GMT


With one slash does it work? ^Icon\r

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Thursday Sep 29, 2016 at 19:45 GMT


Agh, of course the test method escapes the \r by itself. Brb, fixing.

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Thursday Sep 29, 2016 at 19:48 GMT


@ficristo see adobe/brackets@0c3b286

@core-ai-bot
Copy link
Member Author

Comment by hadome
Friday Oct 14, 2016 at 15:35 GMT


Thank's but how I execute this command?

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

No branches or pull requests

1 participant