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

Curate sample prompts #7884

faho opened this issue Mar 31, 2021 · 3 comments

Curate sample prompts #7884

faho opened this issue Mar 31, 2021 · 3 comments


Copy link

faho commented Mar 31, 2021

Our sample prompts are mostly a random grab bag of prompts someone wrote once.

We should see that the selection

  • is distinct - there's no real reason for two prompts that just differ in a color or one bit of information
  • is well-written
  • uses our common facilities (e.g. fish_vcs_prompt) where desirable

Personally, I would:

  • kick out the "justadollar" prompt because I don't think it serves most people well and is trivial to write yourself
  • remove the "informative vcs" prompt because the informative git status is sloooooow - or make it, ironically, not "informative"
  • remove two out of three "classic" prompts
  • remove the "screen savvy" prompt because I have no idea what it's for - where is $WINDOW set?
  • add debian chroot support to other prompts and remove that one
  • rename the prompts named after a single person because some may have... "spicy" opinions that don't align with our CoC and we don't want to appear like we're condoning those

We might also want to add new prompts - what are y'all using? Anyone have a cool prompt they want to share?

@faho faho added this to the fish-future milestone Mar 31, 2021
Copy link

IlanCosman commented Mar 31, 2021

Highly agreed, I was just thinking about this myself 👍 I think a very simple pure-style prompt would be a great addition, though that does kinda step on third-party authors' toes 😄

Copy link
Member Author

faho commented Apr 2, 2021

Alright, here's a screenshot of what the prompts currently look like, in an actual terminal:


The first thing you'll notice here is that these are almost all variations on a very simple theme, basically:

user@host pwd status/vcs glyph

Some leave off one or more of these or add a little special thing (debian chroot has the debian chroot, "informative" has the time), but the bulk of these stick very closely to that idea.

In particular:

  • "debian_chroot" is literally the classic prompt plus a debian chroot display that I'm not sure is actually used - you would need to specifically select it in the chroot (this is the sort of thing that's really only worth it as a default, and then it shouldn't just be for debian specifically - I've asked for this before and been met with resistance)

  • classic status/vcs are just straight upgrades of each other - these could just be one prompt with easily removable bits

  • I have no idea what lonetwin and screen savvy are

  • acidhub, terlar, robbyrussell and sorin use their own git logic - this should probably be centralized in the git prompt (and robbyrussell specifically does the awful thing of checking git status just to determine if there is anything - effectively asking for a full directory scan when the first hit would suffice)

Copy link
Member Author

faho commented May 2, 2021

Alright, that was a bit of a project, and I'm calling it done for now.

Here's roughly what changed since 3.2:

  • The classic, classic+status, classic+vcs were unified as one "default" prompt.
  • The debian chroot prompt was removed, the special thing it did was put into the prompt_login helper function that's used by the default and terlar prompts - this also means you'll get the logic by default
  • The robbyrussell prompt was renamed to "arrow" and no longer uses git status --porcelain just to figure out if the repo is dirty, improving performance in slow git repos. The sorin prompt was renamed to "scales".
  • The "justadollar", "screen_savvy" and "lonetwin" promps were removed as they didn't do anything special (and justadollar in particular is unhelpful and easy to write yourself)
  • Two new prompts were added - "simple", which is roughly along the lines of a "nice" bash prompt - just user@host, prompt_pwd and a user symbol ("$" or "#" depending on if you're root). No frills, no vcs prompt, no nothing. And "disco", which is my own prompt and a bit more... playful than the rest. It colors $PWD, shows USER@HOST when in a remote environment (ssh or vm), has a right prompt with vcs info (with some settings I like).
  • Selecting a prompt can now be done via fish_config prompt, including e.g. fish_config prompt choose arrow in, so it's easier to switch in non-desktop machines (e.g. via ssh).
  • The default prompt now handles dumb environments (i.e. TERM=dumb) better
  • fish_config now handles right prompts

This leaves us with a total of 12 instead of 16 prompts, but they are more distinct from one another and in some cases faster and less buggy.

Now, this isn't "done", it'll never be fully done. I'd still be willing to accept people submitting interesting, even goofy, prompts provided they are well-written and, when they use an external dependency, handle failure well.

Other enhancements, e.g. using fish_git_prompt instead of bespoke git logic or spicing up prompt_login to support other kinds of "machines", can simply be done later.

To top it off, here's a screenshot:


@faho faho closed this as completed May 2, 2021
@faho faho modified the milestones: fish-future, fish 3.3.0 May 2, 2021
@faho faho removed the RFC label May 2, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

2 participants