Skip to content

docs: undocumented functions #6695

Open

Description

@ammgws

In share/functions there are a bunch of fish_* functions, however the docs only list these:

fish_breakpoint_prompt - define the prompt when stopped at a breakpoint
fish_config - start the web-based configuration interface
fish_git_prompt - output git information for use in a prompt
fish_hg_prompt - output Mercurial information for use in a prompt
fish_indent - indenter and prettifier
fish_key_reader - explore what characters keyboard keys send
fish_mode_prompt - define the appearance of the mode indicator
fish_opt - create an option spec for the argparse command
fish_prompt - define the appearance of the command line prompt
fish_right_prompt - define the appearance of the right-side command line prompt
fish_svn_prompt - output Subversion information for use in a prompt
fish_update_completions - Update completions using manual pages
fish_vcs_prompt - output version control system information for use in a prompt

Putting aside those that should really be _fish* functions, there are these functions below that perhaps should be documented as well:

fish_clipboard_copy.fish
fish_clipboard_paste.fish
fish_default_key_bindings.fish
fish_default_mode_prompt.fish
fish_hybrid_key_bindings.fish
fish_title.fish
fish_vi_cursor.fish
fish_vi_key_bindings.fish

Or have they been left out on purpose?

(Came across this while fixing #6694 as there was no page for fish_vi_key_bindings)

Activity

  1. added
    docs
    on Mar 1, 2020
  2. added this to the fish-future milestone on Mar 1, 2020
  3. faho commented on Mar 3, 2020

    @faho
    Member

    Putting aside those that should really be _fish* functions,

    They should not. They're for use by normal users, so they should just be called fish_.

    If anything, we're overusing dunderscores.

    Or have they been left out on purpose?

    No, just an oversight.

  4. Delapouite commented on Mar 3, 2020

    @Delapouite
    Contributor

    Related issue about documenting *bindings.fish functions: #5764

  5. ammgws commented on Mar 4, 2020

    @ammgws
    ContributorAuthor

    @faho I was referring to things like the npm completion helper function that was mixed in there

  6. charego commented on May 5, 2020

    @charego
    Contributor

    Another related issue (with fewer details): #5630

  7. andmis commented on Dec 2, 2021

    @andmis
    Contributor

    As of today on master, this is the list of functions (computed by looking at share/fish/functions of a clean install) which don't have associated docs (computed by looking at share/man/man1 of a clean install):

  8. andmis commented on Dec 2, 2021

    @andmis
    Contributor

    It looks like delete-or-exit is intended to implement readline's Ctrl-D. This was reimplemented in C++ at some point and the fish function was not deleted. I'm not sure it's still needed.

  9. floam commented on Dec 2, 2021

    @floam
    Member

    Hey thanks for doing that work. I'm gong to either copy those up to the top of this this issue or maybe look into that Project section. We really should try to have these all documented and commented. They should also not do anything too terrifying if someone runs them on accident.

  10. floam commented on Dec 2, 2021

    @floam
    Member

    As of today on master, this is the list of functions (computed by looking at share/fish/functions of a clean install) which don't have associated docs (computed by looking at share/man/man1 of a clean install):

    So, while I do find the information useful, I think I'll share my view, which is that we shouldn't necessarily want or expect every single one of those scripts to have a manual page.

    There are a few different types of documentation, and some existing conditions that vary a bit with varying ideal solutions.

  11. floam commented on Dec 2, 2021

    @floam
    Member

    My thoughts:

    • Sone of those files are wrappers - purely mechanical shims that we definitely do not want to bother users about, like man.fish or seq.fish. seq.fish should really probably just be put out to pasture. These should have a decent comment at the top explaining what is going on, perhaps self-documenting, and that's about it.
    • setenv should be documented properly, it should print usage information, etc, appear as a shell utility in the docs, that so people can figure out about it. Or we should get rid of it.
    • nextd-or-forward-word.fish, up-or-search.fish, … I really hate these readline functions that are effectively "hanging out in PATH". They'll needs to be documented with the other "Additional functions" in bind.rst. I really wish we had a way to effectively toss them in the fish equivalent of a libexec dir like we do completions, to keep them out of PATH. They are just not to be ran interactively. It should have some comments added that explains what it does.
    • now this stuff
      fish_clipboard_copy
      fish_clipboard_paste
      fish_commandline_append
      fish_commandline_prepend
      fish_default_key_bindings
      fish_default_mode_prompt
      fish_hybrid_key_bindings
      fish_is_nth_token
      fish_job_summary
      fish_print_git_action
      fish_print_hg_root
    
    • also should not get manpages, I don't think. But when I see fish_ in front of a tool, I've said before, to me we are advertising it's a utility people should run. Like fish_config, fish_indent, etc. The exact way we namespaces all the things was misguided, considering we control the functions path. Then the underscores were even worse. Anyhow, it may be too late to strip them them of their prefix or hide them away because scripts rely on them, but we should make sure these, when ran interactively, don't mess up folk's configurations and print out some reasonable usage information.
  12. faho commented on Dec 2, 2021

    @faho
    Member

    seq.fish should really probably just be put out to pasture

    If you want to abandon OpenBSD support,...

    nextd-or-forward-word.fish, up-or-search.fish, … I really hate these readline functions that are effectively "hanging out in PATH"

    These should just be reimplemented in C++.

  13. floam commented on Dec 2, 2021

    @floam
    Member

    If you want to abandon OpenBSD support,..

    No, I don't. It's fine. It's pretty simple.

  14. rose2221 commented on Oct 20, 2023

    @rose2221

    Can you specify the file name which need to be changed

  15. frinzzyy commented on Apr 4, 2025

    @frinzzyy

    i would like to work on these undocumented functions and deifining the need for them, but can you define the left out functions that need to be added.

  16. kovan commented on Mar 26, 2026

    @kovan

    All public functions listed in the original checklist now have documentation pages in doc_src/cmds/. The only function without a doc page is N_, which is an internal internationalization helper. This issue can be closed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docs

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions