Generally, when I look for a man page, it comes up immediately and the Terminal title bar shows less - man <cmd>
But the first time I do it after a restart, there is a delay of two or more seconds, and the title bar says xcodebuild - man <cmd>
I have not seen this delay on any other command and I use zsh or bash for more than an hour every day.
Why does this happen and/or is there a way to stop it? Is less or man calling something something that has to be compiled and/or linked and cached? Both less and man are universal binaries dated 24 Aug 2022 with no ACLs or xattr.
@fd0:
The profile does write a new path. I thought I had changed it to merely add ~/bin to the beginning of the path but it is setting the entire path (not any more; fixed). man -w shows man pages inside the Xcode.app but they are actual man pages (troff input). Do they or troff have to be built and cached periodically? The call and delay do not happen unless there has been significant delay, not even if Terminal (and zsh) have been dismissed and relaunched.
(Adding ~bin to the beginning of the path is risky because it makes it easier for malware—if any—to override common shell commands. But I wrote a script named ~/bin/ED, which thanks to HFS could not be an alternate to /bin/ed without putting ~/bin at the beginning.)
WGroleau@MBP ~ % man -w
/usr/bin/man
WGroleau@MBP ~ % grep MANPATH .??*
(nothing found)
man -w and man -w chmod also invoke xcodebuild
After xcodebuild -license accept and reboot, man chown still invokes xcode build, but interestingly, the delay is much shorter than in the past. So I’m still curious why man requires xcodebuild. That invocation and delay did not happen a few versions back (but XCode was installed then). Also odd that the install would not have taken care of the license (or why Xcode keeps asking for command line tools.)
man -w? – fd0 Oct 03 '22 at 13:17xcodebuild -license acceptand check whether the problem disappears? – nohillside Jun 19 '23 at 06:43/usr/bin/manto be the output ofman -wnor would i expect(nothing found)to be the output ofgrep MANPATH .??*. – fd0 Jun 19 '23 at 15:42man mansays thatman -wshows the location of the man page. So it presumably must be followed by a command that has a man page. I'll edit the Q. "(nothing found)" indicates the the string "MANPATH" does not appear in .zshrc or .profile or any other init file. – WGroleau Jun 19 '23 at 15:56xcodebuild -license accepttook a long time to get around to asking my to do it with sudo, and that took seven seconds. Because of caching, I need to reboot to see whether themanstill invokes xcodebuild. – WGroleau Jun 19 '23 at 16:00man chownstill invokes xcode build, but interestingly, the delay is much shorter than in the past. – WGroleau Jun 19 '23 at 16:09