Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

`help` is useless if you ssh into a machine #351

Closed
Soares opened this Issue Oct 17, 2012 · 15 comments

Comments

Projects
None yet
7 participants
Contributor

Soares commented Oct 17, 2012

Sometimes I ssh into a machine running fish. help dutifully opens the help in a web browser on a monitor that's miles away from me, which is pretty useless when I'm struggling to figure out what a command does in the first place.

I understand that fish is trying to be really user friendly with the in-browser documentation and everything, but it would be really really nice to have a help --local option or something of the sort for those times when I'm sshing (or when I just don't feel like touching my mouse).

Contributor

Soares commented Oct 17, 2012

Note: I understand that this isn't quite the intended use of help, and would also be totally cool with manual entries for fish commands. Currently, though

> man set
No manual entry for set
> man bind
NAME
    bind - bind a name to a socket
...

it's not exactly what I was looking for.

Member

zanchey commented Oct 20, 2012

help works okay (modulo #342) over SSH for me - it opens links or another sensible-browser. If I have $DISPLAY set by Xforwarding then it opens my default graphical browser over remote X; what is your $DISPLAY?

Contributor

Soares commented Oct 20, 2012

Oh, it works: it opens my browser on the screen on the computer that I'm ssh'd into, which is usually miles away. I suppose I could unset $DISPLAY upon sshing in.

gustafj commented Oct 23, 2012

Help is really great imo, but I would also like man pages as a compliment.

Contributor

terlar commented Oct 23, 2012

It doesn't work at all for me, just says:

sed: can't read /usr/local/share/doc/fish/commands.html: No such file or directory
w3m: Can't load file:///usr/local/share/doc/fish/index.html.

and on the current computer (no ssh)

sed: /Users/terje/.local/share/doc/fish/commands.html: No such file or directory
The file /Users/terje/.local/share/doc/fish/index.html does not exist.
Owner

ridiculousfish commented Nov 29, 2012

How bad would it be to check for variables like SSH_TTY in help, and if set ignore graphical browsers?

Contributor

Soares commented Nov 29, 2012

Perhaps. It would work for my scenario but I'm not convinced it's a good general solution. If someone were remoting into a machine and also sshing into it, they might want the browser window to come up.

Contrived, I know, but I can also think of scenarios where I'd want help to output text even when I'm not sshing -- e.g. when I know firefox wants to check for updates and I'm not connected to the internet and I don't feel like going through all the damn dialogs because I just want the docs for a simple command.

Making fish commands accessible in the man pages would address the second concern. For the first I prefer explicit to better than implicit. Perhaps help could have a flag (-t for text, -o for stdout, I dunno) that tells help to use the terminal instead of the browser -- I'm not sure how easy such a thing would be (does BeautifulSoup have tools to pretty print text?)

Member

zanchey commented Dec 2, 2012

Tools like the Linux Terminal Server Project use Xforwarding to provide all graphical display, so this would not work too well in that case.

There is also the little difficulty of working out whether your browser is graphical or not; although obviously in general it's easy, some (like links) have both a text and graphical interface.

Owner

ridiculousfish commented Jan 29, 2013

My current thinking is that help should continue to work the way it does today, and man should be made to always show the man pages in the terminal. That means that arranging the manpath so that fish's pages win.

Owner

ridiculousfish commented Feb 2, 2013

Change ff7cbab adds a function man.fish that should promote fish's man pages above those of the rest of the system. Thus you should be able to do man set to see the set man page, and help set to see the help document. I think that's good enough for fish 2.0

Contributor

Soares commented Feb 2, 2013

Awesome! This is very cool.

On Fri, Feb 1, 2013 at 5:20 PM, ridiculousfish notifications@github.comwrote:

Change ff7cbabhttps://github.com/fish-shell/fish-shell/commit/ff7cbab991732fea3c6c744bf6439f797e0c307cadds a function
man.fish that should promote fish's man pages above those of the rest of
the system. Thus you should be able to do man set to see the set man
page, and help set to see the help document. I think that's good enough
for fish 2.0


Reply to this email directly or view it on GitHubhttps://github.com/fish-shell/fish-shell/issues/351#issuecomment-13022286.

Member

faho commented Sep 15, 2015

The man wrapper has been added, help opens a browser. Methinks the only thing left to do is documentation.

@faho faho added the needs docs label Sep 15, 2015

Contributor

pickfire commented Sep 15, 2015

Do you mean opening a text-based browser for help?

Member

faho commented Sep 15, 2015

If you set one as $BROWSER or OS default, yes. I just tested and both w3m and links work.

Member

faho commented Sep 15, 2015

I just checked, and the Help section of our documentation (not to be confused with the section on the help function) already says:

fish also has man pages for its commands. For example, man set will show the documentation for set as a man page.

So I'm considering this done.

@faho faho closed this Sep 15, 2015

@faho faho modified the milestones: next-2.x, fish-future Sep 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment