fish shell integration bad hostname
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: 3.3.7 3.3.8beta and I think 3.3.0beta
- OS version: 10.14.6
- Attach ~/Library/Preferences/com.googlecode.iterm2.plist here (drag-drop from finder into this window)com.googlecode.iterm2.plist
- Add the log debuglog.txt
line 9445 and 38328 shows the error hostname is mini username is mark
Detailed steps to reproduce the problem:
- Run fish as the shell fish, version 3.0.2
- Use iTerm integration - as downloaded 6th Dec
What happened: iTerm thinks the host is current directory. Shows in database and when you change directory you get the paste bracketing warning
What should have happened: Same as in Bash integration the host name should be the host
If I edit .iterm2_shell_integration.fish and in iterm2_write_remotehost_currentdir_uservars hard code a host name it works as expected. Thus I think iterm2_hostname is not set correctly
I am not an expert in shell scripting (if it is longer than 5 lines I use a proper language for this sort of reason) but I think that in fish a variable set using just set is only in scope for the current block
SO as a hack I set iterm2_hostname as a global variable and it seems to work but I have no idea of the other effects. For me I think it is OK as I only have one machine and don't do complex things in fish.
e.g. line 81 onwards I now have
# If hostname -f is slow for you, set iterm2_hostname before sourcing this script
if not set -q iterm2_hostname
set -g iterm2_hostname (hostname -f 2>/dev/null)
# some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option
if test $status -ne 0
set -g iterm2_hostname (hostname)
end
end