Semantic history: public.mpeg-2-transport-stream incorrectly opens in Atom (the text editor)
iTerm2 Build 2.9.20150523-nightly on OS X 10.10.3 stable. But the issue dates back to far earlier — a time that I can't remember. It just happens that I got bitten several times today, so I'm only reporting it now.
I'm trying to open a public.mpeg-2-transport-stream
video file (with .ts
extension, but that doesn't seem to matter) with ⌘+click (my Settings->Profiles->Advanced->Semantic History is set to "Open with default app"). However, the file always opens in Atom.app (the text editor), which is not even in the list of handlers, let alone the default. Here's the UTI and extension association:
> mdls -name kMDItemContentTypeTree video.ts
kMDItemContentTypeTree = (
"public.mpeg-2-transport-stream",
"public.movie",
"public.audiovisual-content",
"public.data",
"public.item",
"public.content"
)
> duti -l public.mpeg-2-transport-stream
com.apple.automator.mpv-launcher
com.apple.local-library
> duti -x ts
mpv-launcher.app
/Users/zmwang/dev/src/cocoa/mpv-launcher/mpv-launcher.app
com.apple.automator.mpv-launcher
Here com.apple.automator.mpv-launcher
is an Automator app. It doesn't matter which app is default though, since even if I change the associate to io.mpv
, or even the stock com.apple.QuickTimePlayerX
, the result would be the same: the file opens in Atom. (You may see that in action in the screencast linked below.) As a side note, MP4, Matroska, etc. opens correctly with the default app (i.e., com.apple.automator.mpv-launcher
), so this issue only applies to certain video codecs/containers/extensions (haven't tested extensively).
Moreover, Atom isn't my default text editor either. In fact, I seldom use Atom (I mostly use Emacs in a tty), and my default handler for public.text
and public.plain-text
is TextEdit:
> duti -d public.plain-text
com.apple.TextEdit
> duti -d public.text
com.apple.TextEdit
I found #3092 (closed) ("Command clicking on .patch file opens wrong editor") that seems to be related, and it says:
If we detect that a file is a text file then we try to open an editor instead of launching the default app. In commit e4472a5d I changed it to use the default app if it is an editor, and that'll be in tomorrow's nightly build.
But I don't see how a public.movie
can be mistaken as text, less why Atom is opened instead of TextEdit, in case it is indeed incorrectly treated as text.
I have switched to "Run command... open \1
" for the moment and it works great, by the way.
Attachments:
Associated screencast: