BuDop's mbp:~ budop$ changes to dhcp-v062-202:~ budop$...not quite why?

the name on my terminal changed from BuDop's MBP:~ budop$ to dhcp-v06:~ budop$ after I set up a local server using nodejs.

This was was I did prior to the change:

I installed a middleware framework for node

  1. npm install connect

  2. created a server file called server.js

  3. ran the node server

When I quit out of the server, I noticed that my terminal name has change. I am pretty new unix user and can't figure why my terminal name has changed.

My questions are:

Why did my terminal name changed?

How can I changed it back to my original name?

I appreciate any guidance this forum can provide.

BuDop

What is your current directory?

Many terminal prompts are configured to show the current directory name as part of it.

currently in my home directory.

Lots of software will fiddle with the window name. I use ksh as my shell. In my .kshrc file I put a function:

        function retitle {
        echo -e "\\033]0;$*\\007\\c"
        }

Now I can just just type stuff like retitle my new window name

But I rarely do. I don't really care about my window name.

@Perderabo: thanks for the reply. I am using bash. I have a .bash_profile file. Do I put the function in there? I haven't done much in that file because I am relatively new to unix and worried that I may make some damage that I can't fix.

As a new unix user, I am curious/concerned with changes that I don't explicitly made myself.

BuDop

.bash_profile is certainly an option. You could just type those lines in at your prompt (or cut and paste). Or you can put them in a file called "anything" and then type source anything to read them in.

I really don't think there's anything to be alarmed about here.

Change into a different directory now, see if it changes again.

If it does, that's all it means -- it's telling you what directory you're in.

Hi Corona,

No matter what directory I am in, the the name dhcp-v062-202:~ budop$ remains. The name of my computer use to reside where dhccp is...so it used to be BuDops-mbp:~ budop$, now it is dhcp-v062-202:~ budop$.

BuDop

---------- Post updated at 04:49 PM ---------- Previous update was at 04:45 PM ----------

Perderabo,

just curious as what this line of code mean "\\033]0;$*\\007\\c".

The "$" in the middle will expand to the arguments you passed to the function. So if I type "retitle my new name", the $ will be replaced with "my new name". The characters in front and in back of the $* are just the escape sequence that instructs the software to retitle its window. There are escape sequences to lots of other stuff like clear the screen, change colors, move the cursor around, etc.

See this page for a list.

Thanks Perderabo.

BuDop

Because the host name is not set on your computer. Bonjour services is setting the host name.

$ scutil --get HostName
HostName: not set

The scutil manual will explain how you can set the host name.

Did you log into anyone else's account during the time when it changed? They may have a PS1 string that changed your terminal title.

No, this is my personal machine. I am the only user.

---------- Post updated at 09:26 PM ---------- Previous update was at 09:22 PM ----------

Thanks xbin,

your comment make sense--I was creating a localhost with nodejs.

BuDop