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

Handle right prompts in webconfig #7930

Merged
merged 2 commits into from
Apr 21, 2021
Merged

Conversation

faho
Copy link
Member

@faho faho commented Apr 14, 2021

Description

This allows webconfig to show and save fish_right_prompt if it is defined in a sample (or the current prompt).

It will not remove an existing fish_right_prompt if there is one.

It looks like this:

Screenshot_20210414_205112

Fixes issue #736 (at least for fish_right_prompt, I don't think we need more).

In addition (and this is optional, it was just nice to get a better screenshot), this adds a slightly simplified version of my own prompt as the "Disco" sample. Here's a preview:

Screenshot_20210414_202949

(the $PWD color depends on the sha of $PWD - this requires sha256sum to be available. if not it'll gracefully fallback to $fish_color_cwd. It will also only show user@host if necessary)

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

@faho faho added this to the fish 3.3.0 milestone Apr 14, 2021
This gets fish to print the right prompt of any sample if it has any,
and then shows it separately.

If there is a right prompt, it will also save it. If not, it will *not* overwrite an existing right prompt.
Some features:

- A nice `►` prompt char with a fallback for non-utf8 systems
- The $PWD is colored depending on its sha, so different directories
  are colored differently, but each directory stays the same
- User@Host is only shown if not on the local machine (ssh or
  virtualization)
- A right prompt with a nice git display, date, duration of the last
  command (if it took over 100ms), and virtualenv
@faho
Copy link
Member Author

faho commented Apr 17, 2021

Changed the layout by removing the spacer div, instead letting the left prompt grow. It now looks like

Screenshot_20210417_173256

@ridiculousfish
Copy link
Member

This looks great to me! Awesome!

@faho faho merged commit f236410 into fish-shell:master Apr 21, 2021
@faho faho deleted the webconfig-right branch April 21, 2021 15:01
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants