8000 Handle right prompts in webconfig by faho · Pull Request #7930 · fish-shell/fish-shell · GitHub
[go: up one dir, main page]

Skip to content

Handle right prompts in webconfig#7930

Merged
faho merged 2 commits intofish-shell:masterfrom
faho:webconfig-right
Apr 21, 2021
Merged

Handle right prompts in webconfig#7930
faho merged 2 commits intofish-shell:masterfrom
faho:webconfig-right

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
@faho faho force-pushed the webconfig-right branch from e324258 to c4bfc43 Compare April 14, 2021 18:59
faho added 2 commits April 17, 2021 17:31
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 faho force-pushed the webconfig-right branch from c4bfc43 to ff5ae56 Compare April 17, 2021 15:31
@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.

2 participants

0