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

Support configuring separate symbols for main status and pipe status #3980

Open
Nemo157 opened this issue May 11, 2022 · 6 comments
Open

Support configuring separate symbols for main status and pipe status #3980

Nemo157 opened this issue May 11, 2022 · 6 comments
Labels
✨ enhancement A new feature implementation.

Comments

@Nemo157
Copy link
Contributor

Nemo157 commented May 11, 2022

Feature Request

Is your feature request related to a problem? Please describe.

When using pipestatus = true it's nice to have the status appear only when the overall pipe failed. After the change in #3750 you must have success_symbol set to blank to get this behaviour, but within the pipe status section there is no symbol to show the successful sub-processes.

(More discussion, and a simple test case in #3746 (comment))

Describe the solution you'd like

Allow configuring a separate success_pipe symbol that is used within the pipe status section, so the desired behaviour can be achieved using something like success_symbol = "", success_pipe = "✔"

Describe alternatives you've considered

@Nemo157 Nemo157 added the ✨ enhancement A new feature implementation. label May 11, 2022
@Nemo157 Nemo157 changed the title Support configuring separate symbols for main status prompt and pipe status prompt Support configuring separate symbols for main status and pipe status May 11, 2022
@IzhakJakov
Copy link
Contributor

@Nemo157
Thank you for opening this issue, I'll try fixing it as soon as I get some free time. I am working full time and nowadays studying for a certification as well.

@IzhakJakov
Copy link
Contributor

format = """
($status )$character
"""

[character]
success_symbol = "$❯"
error_symbol = "[$❯](red)"
vicmd_symbol = "[$❯](yellow)"

[status]
disabled = false
symbol = "X"
success_symbol = "Y"
format = "[$symbol]($style)"
pipestatus_separator = " | "
pipestatus_format = "\\[ $pipestatus \\] = [$symbol]($style)"
map_symbol = true
pipestatus = true

Actual

$❯ Y > true | true

[ Y | Y ] = Y >
$❯ true | false

[ Y | X ] = X >
$❯ false | true

[ X | Y ] = Y >

Expected:

$❯ Y > true | true

@IzhakJakov
Copy link
Contributor

IzhakJakov commented May 25, 2022

@Nemo157 I might be blocked (hopefully just for a short time) by this issue:

❯ cargo run --features config-schema -- config-schema > .github/config-schema.json
    Updating crates.io index
error: failed to select a version for the requirement `libgit2-sys = "^0.13.3"`
candidate versions found which didn't match: 0.13.2+1.4.2, 0.13.1+1.4.2, 0.13.0+1.4.1, ...
location searched: crates.io index
required by package `git2 v0.14.3`
    ... which satisfies dependency `git2 = "^0.14.2"` (locked to 0.14.3) of package `starship v1.6.3 (/Volumes/CaseSensitive/repositories/tmpo/starship)`

I'll try to work around this if I can. Not today though.

@chipbuster
Copy link
Contributor

chipbuster commented May 25, 2022

@IzhakJakov Could you run cargo --version for me and post the output? When you have time, not necessarily immediately.

@IzhakJakov
Copy link
Contributor

❯ cargo version
cargo 1.59.0

@DerRockWolf
Copy link

This would additionally, if success_symbol isn't set, also solve a problem where the pipestatus result is 0, if:
false | true will give this prompt: [❌1 |0 ] =>

In this case I would expect something like this [❌1 |0 ] => ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement A new feature implementation.
Projects
None yet
Development

No branches or pull requests

4 participants