Make help and fish_config work on Chrome OS#7789
Merged
faho merged 2 commits intoMar 7, 2021
fish-shell:masterfish-shell/fish-shell:masterfrom
ilyagr:chromeos-browserCopy head branch name to clipboard
Merged
Make help and fish_config work on Chrome OS#7789faho merged 2 commits intofish-shell:masterfish-shell/fish-shell:masterfrom ilyagr:chromeos-browserCopy head branch name to clipboard
help and fish_config work on Chrome OS#7789faho merged 2 commits into
fish-shell:masterfish-shell/fish-shell:masterfrom
ilyagr:chromeos-browserCopy head branch name to clipboard
Conversation
When `fish` is running in the Chrome OS Linux VM (Crostini), both `help` and `fish_config` opened a "file not found" page. That is because on Crostini, `BROWSER` is usually set to `garcon-url-handler`, which opens URLs in the host OS Chrome browser. That browser lacks access to the Linux file system. This commit fixes these commands. `help` now opens the URL on www.fishshell.com. `fish_config` now opens the URL for the server it starts. Previously, it opened a local file that redirects to the same URL. In the case of `help`, the situation could be improved further by starting a web server to serve help. I don't know of another way to access `/share/fish` from outside the VM without user intervention, and I think that might be a part of the security model for the Crostini VM. It's hard to write a test for this. I checked that `help math`, `python2 webconfig.py`, and `python3 webconfig.py` work on my machine running in Crostini.
This isn't really necessary, but it makes the file look nicer to my eyes. Let me know if you want me to remove this commit.
Contributor
Author
|
I realized that the field I don't know a better way to do this, though. If we are worried enough, we could sacrifice some aesthetics and make sure it never fails: try:
return "garcon-url-handler" in webbrowser.get().name
except NameError:
# Explanation
return False |
Member
Well, that would make PyPy incompatible, which would probably be a bug in PyPy. Considering that the "name" attribute is on the BaseBrowser class I think it's safe enough. Merged, thanks! |
Contributor
Author
|
Thank you, @faho!
…On Sun, Mar 7, 2021, 12:43 AM Fabian Homborg ***@***.***> wrote:
or that it's not present in PyPy.
Well, that would make PyPy incompatible, which would probably be a bug in
PyPy.
------------------------------
Considering that the "name" attribute is on the BaseBrowser class I think
it's safe enough.
Merged, thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7789 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7OTJ4LYLTLACPZAYXSYVDTCM4BZANCNFSM4YXJSJXQ>
.
|
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
fishis running in the Chrome OS Linux VM (Crostini), bothhelpandfish_configcurrently open a "file not found"page. That is because on Crostini,
BROWSERis usually set togarcon-url-handler, which opens URLs in the host OS Chromebrowser. That browser lacks access to the Linux file system.
This PR fixes these commands.
helpnow opens the URL on www.fishshell.com.fish_confignow opens the URL for theserver it starts. Previously, it opened a local file that redirects to the same URL.
In the case of
help, the situation could be improved further by starting a web server to serve help. I don't know of another way to access/share/fishfrom outside the VM without user intervention, and I think that might be a part of the securitymodel for the Crostini VM.
It's hard to write a test for this. I checked that
help math,python2 webconfig.py, andpython3 webconfig.pywork on mymachine running in Crostini.
I also rearranged the imports a little to group them together. It's in a separate commit, let me know if you prefer that I not do that.
Another alternative is to look much harder for a browser installed in the Linux VM. By default, none are installed, I think. I do think a Linux browser should be used if the user has installed it and put it into
BROWSER, though.TODOs: