Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: refresh zcompdump cache file in init script (#8878)
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert. This commit stops proper work of this script on any system except Linux.
cmp on all the BSD's does not have the option of reading from stdin as GNU cmp.
Or modify the cmp invocation, avoiding <<<.
dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does using
<()
fix it? It works on my end:dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's fine. Thanks.
dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, you can update with
upgrade_oh_my_zsh
. Thanks for the bug report!dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still getting this on every launch on macOS 10.13.x (and I am only guessing it's related?):
/Users/user/.oh-my-zsh/oh-my-zsh.sh:89: no such file or directory: /Users/user/.zcompdump-¯\_(ツ)_/¯-5.3
Yes, that's the machines name, don't make me change it.
dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That didn't work before the change, did it?
dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does
echo $HOST ${(%):-%m}
show?dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It did, in fact I never had an issue until recently (and I did not rename the machine).
But I don't know for sure when I updated the last time, but I usually update every day.
The Hostname is different (uppercase and lowercase letters only).
dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just gave it a try on another Mac with the same name (running macOS 10.14.x) that I had not updated and I did not have the issue there.
A
cat .git/FETCH_HEAD
showed it was still on173d4ca68f1ff4b04e9f3fd783244c309d848092
.After I updated (Fast-forwarded master to
0736a3749a9c9ae4ba3096b0b6c55250f19fef17
) it's got the same issue.dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
compinit
call works without problem, but the zcompdump cache file isn't generated. You should change the hostname, otherwise you won't get the cache benefits on startup, and it'll be slower.I can change the echo call to use
tee
instead, that way the error can be silenced.I still think this is a hack and you'll have to change the hostname due to other problems.
EDIT: pushed the fix, update with
upgrade_oh_my_zsh
.dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hostname is fine, it's something like AbcDefGhijk:
scutil --get HostName
returnsAbcDefGhijk
scutil --get ComputerName
returns¯\_(ツ)_/¯
scutil --get LocalHostName
returnstsu
So I would argue it's the use of the ComputerName instead of HostName or LocalHostName that causes the problem, regardless of how messed up my ComputerName is ;P
Would using
$HOST
instead of$SHORT_HOST
cause other issues?I can live with the slower auto-completion though.
Thanks!
dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been wanting to use
${HOST/.*/}
or${(%):-%m}
instead ofComputerName
for macOS. It seems those change with dhcp though, so I don't know how fitting would be to make that change.dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about
hostname -s
?dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: Not that it bothers me much, but these are back
/Users/user/.oh-my-zsh/oh-my-zsh.sh:88: no such file or directory: /Users/user/.zcompdump-¯\_(ツ)_/¯-5.3
Created autostash: 447d1e8f
HEAD is now at c58572d init: oops
dd1a726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I accidentally deleted the hack because I forgot. It should work again now.