Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

"ComputerName: not set" message on startup #2155

Closed
JJJollyjim opened this Issue · 12 comments

7 participants

@JJJollyjim

Since a recent update, I have been getting a ComputerName: not set message whenever I start a new shell:

ComputerName: not set

The error occurs in iTerm and the built-in Terminal. I'm on the latest oh-my-zsh, and this zsh version:

~ $ zsh --version
zsh 4.3.11 (i386-apple-darwin12.0)
@zeroDivisible

From what I had seen, that one is caused by the following line in oh-my-zsh.sh and was changed in d2fe03d

@JJJollyjim

That seems to be the cause: if I run scutil --get ComputerName I do get this error. echo ${HOST/.*/} prints localhost for me, which I assume is what should be coming from scutil. My $SHORT_HOST is empty.

@JJJollyjim

By the way, I just updated from Apple's zsh (4.3.11) to brew's (5.0.2), and it still shows this message.

@ismailasci ismailasci referenced this issue from a commit in ismailasci/oh-my-zsh
@iasci iasci Fixes "ComputerName: not set" issue #2155 d4d768d
@teddyknox

The quick fix is scutil --set ComputerName "<computer name>".

@JJJollyjim

That works well, the errors have stopped. That pull request looks good though.

@ryh ryh referenced this issue from a commit
Christian Höltje Create the zcompdump based on version and host
This will prevent lots of subtle problems that happen when
people upgrade ZSH or use NFS mounted home directories.

The ZSH_COMPDUMP variable can also be used to implement `zcompile`
and other fun features in the future.
d2fe03d
@davidnknight

Just posting to say that this issue still exists. Used the command that @teddyknox wrote above, seems to have fixed it, at least for now.

☁ ~ zsh --version
zsh --version
zsh 5.0.2 (x86_64-apple-darwin13.0)

@docwhat

@davidnknight and @jj56

How did you get a Mac up without setting your ComputerName? I want to understand how this happened so I can fix the code correctly.

Thanks.

@ncanceill

Well technically a simple sudo scutil --set ComputerName "" will have this effect.

@docwhat

@ncanceill Thanks! Now I can reproduce the problem. I have a fix that falls back to the default. I'll push it up momentarily. Do you think I should check LocalHostName first before going back to the default?

@docwhat docwhat referenced this issue from a commit in docwhat/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
c45d5cf
@ncanceill

No.

The manual page scutil(8) says:

LocalHostName The local (Bonjour) host name.

But according to an Apple article about Bonjour hostnames:

If you enter a name that is already in use on your subnet, a numeral will automatically be added to distinguish it from the original. This change may not appear in the Sharing preference pane immediately. Example: If "mycomputer.local" is already on the network and you try the same name, your computer would automatically be renamed to "mycomputer2.local".

So LocalHostName may change when switching networks, eg if alice.local joins a network where alice.local already exists.

@docwhat

That's what I thought, but the man page wasn't descriptive enough about any of this. Thanks.

@evacchi

Hi, this is still a problem on my machine; I am patching oh-my-zsh.sh manually (I have commented out the offending if), and I stash the change at each update. #2743 seems to fix this in the best way (redirects stderr to /dev/null) can it be merged?

@docwhat docwhat referenced this issue from a commit in docwhat/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
00b21d5
@robbyrussell robbyrussell closed this in #2743
@hoggarth hoggarth referenced this issue from a commit in hoggarth/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
17c5df5
@swanandp swanandp referenced this issue from a commit in swanandp/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
e8ad81e
@ArjenSchwarz ArjenSchwarz referenced this issue from a commit in ArjenSchwarz/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
a8e6182
@mbologna mbologna referenced this issue from a commit
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
55b932a
@Stibbons Stibbons referenced this issue from a commit in Stibbons/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
ce1dfa9
@jefflance jefflance referenced this issue from a commit in jefflance/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
cb454c8
@mohitsethi mohitsethi referenced this issue from a commit in mohitsethi/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
320e0ee
@ajordens ajordens referenced this issue from a commit in ajordens/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
edd1b0d
@noj noj referenced this issue from a commit in noj/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
d4740b3
@kogakure kogakure referenced this issue from a commit in kogakure/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
b991ca5
@benjaoming benjaoming referenced this issue from a commit in benjaoming/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
940ba79
@trynity trynity referenced this issue from a commit in trynity/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
4a8e0a1
@guneysus guneysus referenced this issue from a commit in guneysus/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
25a99e3
@kenton kenton referenced this issue from a commit in kenton/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
7ddc433
@fornwall fornwall referenced this issue from a commit
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
c530c9d
@Kentzo Kentzo referenced this issue from a commit in Kentzo/oh-my-zsh
Christian Höltje Trust but verify 'scutil' to return ComputerName
Apparently, it is possible to set up a Mac such that
`scutil --get ComputerName` hasn't been set.

This change checks if that fails and falls back to the original
mechanism.

Closes #2155
Closes #2183
8023498
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.