1

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.)

6
  • Are you setting MANPATH in one of your shell's init files? Can you edit your post with the command and output from- man -w ?
    – fd0
    Oct 3, 2022 at 13:17
  • Can you run xcodebuild -license accept and check whether the problem disappears?
    – nohillside
    Jun 19, 2023 at 6:43
  • I would not expect /usr/bin/man to be the output of man -w nor would i expect (nothing found) to be the output of grep MANPATH .??*.
    – fd0
    Jun 19, 2023 at 15:42
  • man man says that man -w shows 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, 2023 at 15:56
  • xcodebuild -license accept took 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 the man still invokes xcodebuild.
    – WGroleau
    Jun 19, 2023 at 16:00

0

You must log in to answer this question.

Browse other questions tagged .