Terminal: new terminal window shows : No such file or directory

Joined
Jul 24, 2017
Messages
10
Reaction score
0
When terminal starts or opens a new Terminal window the window looks like this:

Notice that the cursor is at the beginning of the prompt, not following the prompt. When a command is typed it overwrites the prompt, making it hard to read.

The problem is specific to my account. When I log in to a new user account it does not occur.
The problem was not solved by updating from OS X 10.11.6 to OS X 10.12.6.
AppleCare Senior Advisors were unable to solve the problem and suggested updating to 10.12 - which did not help.

It seems likely that when Terminal opens a new window it looks for some file that has gone missing or that a file has become corrupted. Does anyone know which files Terminal accesses when it opens a new window and where those files are located?

I tried to move the info.plist file that is in Terminal.app/Contents in the hope that restarting Terminal would then generate a virgin uncorrupted info.plist file. Sasly any attempt to modify anything in the Terminal.app folder returns a message that it can't be moved or modified because Terminal is required by the OS. Does anybody know a way to circumvent that problem?

Any help most appreciated.
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,089
Reaction score
490
Hello and welcome.

Can you take a screenshot of the issue and post it here so we can take a look at it? (Seems like you tried to post it, but it doesn't show.)

Sounds like some form of default has been changed and you are seeing a non-default shell in the Terminal window.

C
 
Joined
Jul 24, 2017
Messages
10
Reaction score
0
Hello and welcome.

Can you take a screenshot of the issue and post it here so we can take a look at it? (Seems like you tried to post it, but it doesn't show.)

Sounds like some form of default has been changed and you are seeing a non-default shell in the Terminal window.

C
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,089
Reaction score
490
You can't modify files inside the Terminal.app package itself. You could try deleting the com.apple.Terminal.plist file in your hidden User Library > Preferences folder.

Do you know how to access that?

C
 
Joined
Jul 24, 2017
Messages
10
Reaction score
0
First, thank you for responding to my post. I did indeed try to include a screenshot, and I should have noticed that it didn't come through in the preview.

I am now trying to add it by uploading a jpg screenshot.
 

Attachments

  • Terminal.jpg
    Terminal.jpg
    28.9 KB · Views: 433
Joined
Jul 24, 2017
Messages
10
Reaction score
0
You can't modify files inside the Terminal.app package itself. You could try deleting the com.apple.Terminal.plist file in your hidden User Library > Preferences folder.

Do you know how to access that?

C
Yes I do. Thanks. I didn't know where to find that plist.
I have now removed com.apple.Terminal.plist file and restarted Terminal but it made no difference.
 
Joined
Jul 24, 2017
Messages
10
Reaction score
0
When I moved the com.apple.Terminal.plist file from /~/Library/Preferences to the Desktop and restarted Terminal it regenerated the file inside Preferences with the Basic setting as default, but that didn't change the issue.

Terminal must access some file other than com.apple.Terminal.plist when a new window is opened, a file that is missing (hence the : No such file or directory that is printed to the Terminal window). It must also issue four calls some executables, hence the four : command not found that are printed. I wonder whether the missing file contains the paths to those executables?
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,089
Reaction score
490
Try the reset in the link I provided above: Terminal > Preferences... > Profiles > Basic > clcik gear icon next to + and - buttons > Restore Default Profiles. See if that restores it.

Also, You could try to type exit and then press return, or Control-C and see if it goes back to the normal bash prompt - i.e. imac:~ yourname$.

Had you previously been in Terminal running a different shell than bash?

C
 
Joined
Jul 24, 2017
Messages
10
Reaction score
0
When terminal starts or opens a new Terminal window the window looks like this:

Notice that the cursor is at the beginning of the prompt, not following the prompt. When a command is typed it overwrites the prompt, making it hard to read.

The problem is specific to my account. When I log in to a new user account it does not occur.
The problem was not solved by updating from OS X 10.11.6 to OS X 10.12.6.
AppleCare Senior Advisors were unable to solve the problem and suggested updating to 10.12 - which did not help.

It seems likely that when Terminal opens a new window it looks for some file that has gone missing or that a file has become corrupted. Does anyone know which files Terminal accesses when it opens a new window and where those files are located?

I tried to move the info.plist file that is in Terminal.app/Contents in the hope that restarting Terminal would then generate a virgin uncorrupted info.plist file. Sasly any attempt to modify anything in the Terminal.app folder returns a message that it can't be moved or modified because Terminal is required by the OS. Does anybody know a way to circumvent that problem?

Any help most appreciated.
Try the reset in the link I provided above: Terminal > Preferences... > Profiles > Basic > clcik gear icon next to + and - buttons > Restore Default Profiles. See if that restores it.

Also, You could try to type exit and then press return, or Control-C and see if it goes back to the normal bash prompt - i.e. imac:~ yourname$.

Had you previously been in Terminal running a different shell than bash?

C
Try the reset in the link I provided above: Terminal > Preferences... > Profiles > Basic > clcik gear icon next to + and - buttons > Restore Default Profiles. See if that restores it.

Also, You could try to type exit and then press return, or Control-C and see if it goes back to the normal bash prompt - i.e. imac:~ yourname$.

Had you previously been in Terminal running a different shell than bash?

C
 

Attachments

  • Terminal.jpg
    Terminal.jpg
    28.9 KB · Views: 394
Joined
Jul 24, 2017
Messages
10
Reaction score
0
Yes, I did try those things and they had no effect. Everything still leaves the cursor at the beginning of the prompt.
No, I have not changed the shell I am using.

I really do appreciate your efforts.

I also tried using the Terminal emulator iTem instead of Terminal, but got exactly the same problem. I conclude that iTerm actually uses Terminal but adds a few more features.
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,089
Reaction score
490
OK, thanks for the image.

Looks like you are running Terminal in bash with Barry G. Hall's settings as the default startup profile. The No such file or directory and command not found looks like Terminal is trying to find something in those settings...possibly a background image and/or a Shell command that is set to run at startup?

Try changing the default Profile back to Basic or Homebrew, set it as the Default profile, quit and restart Terminal.

C
 
Joined
Jul 24, 2017
Messages
10
Reaction score
0
I tried that - several times, in fact, with several of the provided profiles - and it made no difference at all except in the appearance of the Terminal window. I still get :Nos such file or directory and :command not found lines printed to the Terminal window.

At this point I am quite confident that the problem does not lie in the Profile or in the com.apple.Terminal.plist file where the setting are stored.
 
Joined
Jul 24, 2017
Messages
10
Reaction score
0
It may be in the hidden bash profiles in the root of your user folder.

Again, make sure you have a current backup of your data.

-Bash command not found appearing every time I start terminal

C
Problem Solved!

It was indeed in my .bash_profile file. Moving that file to the desktop solved the problem. I then made a new .bash_profile file and recreated the contents of the old file line-by-line, testing each time for the problem.

Problem never reappeared, so I don't know the nature of the file corruption, but I am gratgeful to you for your persistent help.

Thank you, thank you!
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,089
Reaction score
490
No worries...glad we got it resolved.

Normally, I don't suggest editing hidden files and/or more invasive solutions like that, but it seems you have the skill set and experience to work through this type of troubleshooting.

Be well,

C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top