-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terminal.app "Open man Page" context menu and 'x-man-page' URI scheme not working in Apple Silicon for brew formulae #16074
Comments
Yeah this has been a thing forever. You've indeed found the way to solve that, but there is perhaps more we can do here in at least documentation. What's changed here is that the solution you propose didn't exist prior to Ventura as far as I know, so is relatively new. |
@marc-medley just to summarise and make sure I've understood:
|
correct. |
This will be because |
Some
/etc/man.conf # Every automatically generated MANPATH includes these fields
#
MANPATH /usr/share/man
MANPATH /usr/local/share/man
MANPATH /usr/X11/man
MANPATH /Library/Apple/usr/share/man
#
# Uncomment if you want to include one of these by default
#
# MANPATH /opt/*/man
# MANPATH /usr/lib/*/man
# MANPATH /usr/share/*/man |
Ventura switched the implementation from an old GPL |
Hello! New contributor here, please be gentle. :-) I have reproduced this issue under macOS Sonoma 14.0 on an M1 MacBook Air. Since the What I thought was weird is that, with This is because, according to
So, starting from |
Here are three possible approaches. From reading this discussion it seems that the first one might be preferred? Do we have to detect different systems and decide between 1 and 2 on the fly?
I can open a separate issue about possibly removing the |
This seems like the best option here given the relatively niche nature of the feature and fact that Intel Macs are no longer sold. |
Some thoughts relative to three possible approaches…
On older macOS systems, the existance of On Intel Ventura, the existance of This option provides a useability convenience for Homebrew users on macOS Ventura and future macOS versions. ... without a negative impact on Intel macOS & past macOS versions.
I would be hesitant to modify
Independent of any Homebrew install/update process, some user documentation/info in-context (e.g., |
Sorry if I was too slow editing my earlier post, but I did in fact reproduce this on Apple Silicon. |
@heller Sorry, missed that: can you repeat? |
@heller Does/did placing a /usr/local/etc/man.d/homebrew.man.conf ### Homebrew
MANPATH /opt/homebrew/share/man
MANPATH /opt/homebrew/Cellar/*/*/share/man |
My fault, I should have been more clear. I was responding to this from @MikeMcQuaid:
I interpreted "Intel Macs are no longer sold" to mean that perhaps Mike thought that the issue only affects Intel Macs, and would therefore affect fewer and fewer users as time goes by. |
Yes, this causes the Terminal.app contextual menu "Open man Page" to display a manpage for |
@heller Thank you for confirming. |
@MikeMcQuaid I think that the ‘niche … feature’ and ‘Intel Macs are no longer sold’ framings are somewhat misleading. Below is my perspective for your consideration: ‘niche’ → ‘ubiquitous’
Terminal.app is not an "addon" application for macOS. Terminal is ‘ubiquitous’ across all macOS official distributions. The Terminal This is a stardard, built-in, out-of-the-box feature for all macOS systems. It's a ‘ubiquitous’ macOS feature. ‘ARM’ & ‘Intel’ Mac
A value of having Intel Macs and ARM Macs side by side is software regression testing. The issue authored here is about a software regression where a Homebrew feature that had ubiquitously worked before stopped working. For macOS Homebrew on Intel, this feature "Just works!" out-ot-the-box everywhere. Now it's broken for Homebrew installed on Apple Silicon. This issue is not fundamentally about some missing documentation. The issue here is about a software regression bug which can be fixed for macOS Ventura (and newer) systems. The side-by-side macOS Intel Homebrew and macOS ARM Homebrew Ventura systems enabled the investigation into the root cause and the discovery of a low-complexity software solution for this issue. Downstream vs Upstream Fix In general, an upstream fix at a single orginating source is preferred to a downstream fix in many diverse locations. Placement of a
Summary The Terminal "Open man Page" & A side-by-side Intel and ARM Homebrew installation enabled the discovery of this bug and fault isolation to find a durable uncomplicated fix of adding Genuinely fixing the fundamental issue upstream at the distribution source for macOS homebrew users makes homebrew easier for any particular user. Ease of use promotes use. |
It's standard but it's not widely used. If it was: this would not be the first complaint I've heard about this not working in my 14 years maintaining Homebrew 😉. There's a difference between a feature that's widely enabled and a feature that's widely used by Homebrew users. This is clearly not one of those features.
It also has the disadvantage of requiring Homebrew to write files outside of If we were to go down this route: it would make an argument for writing to e.g.
It just doesn't make Homebrew easier for any user, that's an exaggeration. It only makes things easier for the users who want to use this feature with manages for Homebrew-installed software. This is not a significant proportion of Homebrew users. Honestly, it's not even clear it's literally any users beside yourself. As a result, the solution we should take here is a simple one that's in keeping with how things in Homebrew are already, typically done. To me that's a solution that only involves automatically writing files somewhere within the |
As a Homebrew user who wasn't aware of this feature until a few days ago, it would certainly be surprising for my next How do we decide whether to add something like this as an INFO-level-ish output of Homebrew supports several flavors of Linux, and at the moment I don't know if the proposed |
Yup, strongly agreed.
Agreed, My thinking is this is probably best placed in somewhere like https://docs.brew.sh/Tips-N%27-Tricks |
@heller Valid point. In my comments, the scope for There was a time (circa 2009-2018) when Homebrew was Mac OS X/OS X/macOS only. As a long-time mac/homebrew user, I still tend to think of homebrew as a "mac app". My recent comment has been updated to clarify the macOS scope, which is also the same scope as the original post. Thanks. |
@MikeMcQuaid Your comments, along with the comments of others, have provided several valuable insights. Much to think about. I will be pondering/rethinking this issue over the weekend and will provide some re-focused comments sometime next week. btw, I'm an old school command line user. My command line adventures started in 1975 with Thanks for your many years with Homebrew. Respect. |
@marc-medley Thanks for the kind words ❤️ and well done on surviving 40 years of Unix 😅 |
@MikeMcQuaid, @heller As noted above, I am working through some additional (hopefully, well thought-out & relevant) comments for your consideration.
I would appreciated being allowed this week for adding such comments before this issue is closed out. Would this be possible? Thanks. |
@marc-medley As noted on the other issue: let's continue talking now this is closed and can reopen if we agree on something actionable. Thanks! |
OK. Works for me. Thanks. |
brew doctor
outputVerification
brew doctor
output" above saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
twice and am still able to reproduce my issue.brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.brew config
outputWhat were you trying to do (and why)?
I was trying on open the Terminal.app "Man Page" view for formulae installed via
brew
.Approaches that I use were the "Open man Page" via context menu item and the
x-man-page
URI scheme. These approaches are detailed in the "step-by-step reproduction instructions".Why?
x-man-page://
links in Markdown files provide quick incontext information lookup.What happened (include all command output)?
The "Man Page" would open with the message "No manual entry for
ABC
", whereABC
is anything related to the brew installation. e.g.,brew
,gnuplot
,octave
, etc.This issue was discovered on an Apple ARM macOS system. This issue was verified to not be present on an Intel x86_64 macOS system.
Additional Findings
I was puzzled because the command
man brew
on the command line itself would function as expected using the defaultless
pager.I found that
MANPATH
in the.zshrc
was not resolving the issue on macOS Ventura with Terminal 2.13.After reading documentation and some trial-and-error, I found that the addition of a 'homebrew.man.conf' to '/usr/local/etc/man.d' resolved the issue.
/usr/local/etc/man.d/homebrew.man.conf
Apparently, the Terminal "Open man Page" context menu item and
x-man-page
URI scheme have a more limit man search which appears to just include/etc/man.conf
and/usr/local/etc/man.d/*.conf
.What did you expect to happen?
I expected a new Terminal "man Page" window to open with the
man
content of the brew-installed-item because theman brew-installed-item
command was functional in the command line interface.For example, the not-brew-installed
swift
opens to the following Terminal man page window:Expectations & Possible Homebrew Solution
It seems reasonable to expect that an automated Homebrew installation would include the addition of a
homebrew.man.conf
file in/usr/local/etc/man.d
.It also seems reasonable to expect that
brew doctor
provide some user messaging (ifhomebrew.man.conf
is not present) which enables the user to manually add this file. For example, the brew doctor might mention something like:I also posted the
/usr/local/etc/man.d/homebrew.man.conf
approach on the AskDifferent StackExchange forum.One More Note:
The "FILES" listed at the bottom of the
man
man page appear to be the full search scope for the Terminal "Open man Page" and thex-man-page://
URI Scheme features.If one looks inside
/etc/man.conf
, it is evident why the brew on macOS Intel works OK. The/etc/man.conf
containsMANPATH /usr/local/share/man
which is where macOS Intel Homebrew puts the man folders.It is the new macOS ARM-based homebrew man files placement which can no longer be found under the
/etc/man.conf
&/usr/local/etc/man.d/*.conf
umbrella. Thus, the addition ofhomebrew.man.conf
in/usr/local/etc/man.d
could appropriately be part of the newer Homebrew installation. i.e. the Terminal app did not "change" or "break", rather ARM Homebrew moved to a new-improved location.Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: