Skip to content
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

Add support for file://hostname/... URLs #120

Closed
bhaible opened this issue Aug 10, 2019 · 2 comments
Closed

Add support for file://hostname/... URLs #120

bhaible opened this issue Aug 10, 2019 · 2 comments

Comments

@bhaible
Copy link
Contributor

bhaible commented Aug 10, 2019

A growing number of terminal emulators supports hyperlinks in text output. The specification for this feature, based on an escape sequence, is at https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda . Basically, a user opens a terminal emulators, configures a browser to use (for file, http, https URLs), and runs programs that emit hyperlinks, such as ls --hyperlink (ls from GNU coreutils).

The specification says that file URLs should have the form "file://hostname/...", where the hostname is the result of gethostname() a.k.a. uname -n. (And ls --hyperlink in fact produces URLs of this form.) For this to work, the browser needs to understand these URLs, of course. Firefox can, but w3m - which especially some Emacs users set as their default browser - currently does not:

$ uname -n
omega
$ w3m file:///etc/lsb-release
OK
$ w3m file://omega/etc/lsb-release
w3m: Can't load file://omega/etc/lsb-release.

Here is a patch that implements this feature.

@bhaible
Copy link
Contributor Author

bhaible commented Aug 10, 2019

@tats
Copy link
Owner

tats commented Sep 15, 2020

file-hostname-support.diff.gz

Merged, thanks for your contribution.

@tats tats closed this as completed Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants