gnachman / iterm2-website

Website for iTerm2
http://iterm2.com/
GNU General Public License v2.0
81 stars 65 forks source link

Shell integration scripts generate an error on OpenBSD #41

Closed kotfu closed 7 years ago

kotfu commented 7 years ago

When sourcing the iterm2 shell integration script on OpenBSD, you get the following error:

    hostname: unknown option -- f
    usage: hostname [-s] [name-of-host]

On OpenBSD and NetBSD, there is no -f option for the hostname command. As a result the iterm2_hostname shell variable was always empty. You can work around this issue by setting the iterm2_hostname variable before you source the shell integration script.

gnachman commented 7 years ago

How are you supposed to get the fqdn on OpenBSD?

kotfu commented 7 years ago

I sent a pull request with the changes to fix this problem. On OpenBSD /etc/myname should contain the FQDN. At boot time, the contents of /etc/myname are use to set the host name. "$ hostname" with no options returns the FQDN. See http://man.openbsd.org/myname.5 and http://man.openbsd.org/hostname.1 for all the details.