9 Replies Latest reply: Nov 15, 2009 3:46 PM by Juan Terrazas
Juan Terrazas Level 1 Level 1 (5 points)
When I try to open a folder from Terminal using the open command, instead of a Finder window opening for the folder, another Terminal window opens up with contents like the following:

*Last login: Sat Nov 14 16:14:45 on ttys001*
*jt-imac:~ terrator$ /Users/terrator/Music ; exit;*
*-bash: /Users/terrator/Music: is a directory*
logout

*\[Process completed\]*



In addition, I get the same symptom when I try to open folders from the Dock and Spotlight so I think the problems are related.

I have done the following in trying to resolve this problem:

1. Repair permissions and repair disk with Disk Utility using the Installation DVD after booting from it.

2. Repair LaunchServices using Onyx

3. Created a test user to see if this user has the same problem. No, the problem doesn't happen in this user.

4. Deleted the com.appl.terminal.plist and some other plist files.

5. Reinstalled Snow Leopard on top of my existing installation.

None of those attempts have resolved the problem.

Anyone has any ideas on how to resolve this problem?

iMac Intel 24, Mac OS X (10.6.2)
  • 1. Re: open command in Terminal
    twtwtw Level 5 Level 5 (4,690 points)
    what you've given here doesn't use the open command. that would look like this: open /Users/terrator/Music. does that work? and what do you mean by 'the same symptoms' - are you saying that trying to open a folder from the dock opens a terminal window and tells you that a path is a directory?

    do folder windows open normally in the Finder (by double-clicking)?
  • 2. Re: open command in Terminal
    Juan Terrazas Level 1 Level 1 (5 points)
    Issuing *open /Users/terrator/Music* from home directory doesn't work either. I get the same Terminal window with the warnings as in my original post.

    By same symptoms I mean, if I try to open a folder from the Dock with the context menu then I get a Terminal window with the warnings. And I get the same when I search a folder and try to open it in Spotlight.

    And yes double clicking the folder on a Finder window opens the folder.
  • 3. Re: open command in Terminal
    twtwtw Level 5 Level 5 (4,690 points)
    do you see any pertinent errors listed in Console.app? do you have any third-party hacks or haxies installed?
  • 4. Re: open command in Terminal
    etresoft Level 7 Level 7 (24,270 points)
    Do you have that Microsoft XML Converter installed? I have seen some similar reports from people with that software. I can't seem to find a clever utility to list what application is associated with a file type or folder.
  • 5. Re: open command in Terminal
    Juan Terrazas Level 1 Level 1 (5 points)
    The only lines that I see in the Console when I issue the "open Music" command is the following:

    *09-11-14 8:53:39 PM login[619] USER_PROCESS: 619 ttys001*
    *09-11-14 8:53:39 PM login[619] DEAD_PROCESS: 619 ttys001*

    I have Microsoft Office installed but I don't seem to have the Microsoft XML converter. I looked in the Office directories and I didn't find any files with that name.
  • 6. Re: open command in Terminal
    Jun T. Level 4 Level 4 (2,185 points)
    Does the following work?
    *open -a Finder Music*
    If this works, then maybe LaunchServives database is broken?

    You can use lsregister command to view/modify the database. The lsregister command is in
    /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.fram ework/Support

    cd to this directory, and run
    *./lsregister -h*
    to see some help info. To view the whole contents of the database
    *./lsregister -dump | less*
    Search for a string "Finder.app" and "Terminal.app", and see what types are registered for each app. In my case Folder is registered under Finder.app as follows (id number may differ):

    claim id: 5964
    name: Folder
    rank: Default
    roles: Editor
    flags: apple-default apple-internal
    icon:
    bindings: public.folder, 'fold'
  • 7. Re: open command in Terminal
    Juan Terrazas Level 1 Level 1 (5 points)
    Jun T,

    Thank for your input.

    Issuing "open -a Finder Music" works .

    I did the dump with the lsregister command and for Finder.app I see the following:

    claim id: 59248
    name: Folder
    rank: Default
    roles: Editor
    flags: apple-default apple-internal
    icon:
    bindings: public.folder, 'fold'

    For Terminal.app I don't see anything with name "Folder" but I see one with roles "Editor":

    claim id: 54320
    name: Terminal settings
    rank: Default
    roles: Editor
    flags: apple-internal relative-icon-path
    icon: Contents/Resources/terminal_icon.icns
    bindings: com.apple.terminal.settings

    And I also see one with name being blank:

    claim id: 54376
    name:
    rank: Default
    roles: Shell
    flags: apple-internal
    icon:
    bindings: public.unix-executable

    In any case, the problem doesn't happen in another user on the computer. And I wonder if this database is broken then how do I rebuild it.

    Thanks,

    J.
  • 8. Re: open command in Terminal
    BobHarris Level 6 Level 6 (13,110 points)
    For Terminal.app I don't see anything with name "Folder" but I see one with roles "Editor":

    The Terminal does not execute anything. It is a character terminal emulator that is connected to pseudo (fake) serial terminal device (/dev/pty**)

    The other side of that pty device is attached to an independent process that happens to be running a shell of some kind (default being the bash shell).

    The shell will create child processes on demand and run commands requested by the user. Any text send to standard out or standard error by the shell or any of the children processes started by the shell, will be sent to the pty and the Terminal will read the other side of the pty and display the text in the Terminal window.

    The Terminal will also listen to the keyboard, and send any text you type to the pty where the shell or a child process created by the shell will read the other side of the pty and do what you tell it via the keyboard.

    That is the Terminal's job. communicate through this fake serial device. It does not execute commands. I knows nothing about Folders, nor files, nor TYPE/CREATOR fields, nor file type suffixes. Just reads text you type, and displays text sent back from the shell or its child processes.
  • 9. Re: open command in Terminal
    Juan Terrazas Level 1 Level 1 (5 points)
    Just to update on my problem.

    I restored the ~/Library/Preferences folder from previous backup and it solved the problem. I'm not sure what was broken but I'm up and running now.

    Thanks to all with their suggestions.