Skip to content

fish_config choose leaves previous right prompt in place #8314

Closed

Description

@floam

when switching to a prompt without a right prompt, after a prompt with a fish_right_prompt, you get a nasty result.

e.g.:

$ fish_config prompt choose disco
$ fish_config prompt choose default

Screen Shot 2021-09-24 at 9 45 08 AM

Activity

  1. added
    bug
    on Sep 24, 2021
  2. added this to the fish 3.4.0 milestone on Sep 24, 2021
  3. faho commented on Sep 24, 2021

    @faho
    Member

    This is on purpose. It does not touch the right prompt if there is none. The idea is that this allows you to do more, because you can now add your own right prompt to it.

  4. removed
    bug
    on Sep 24, 2021
  5. floam commented on Sep 24, 2021

    @floam
    MemberAuthor

    It's a UX nightmare.

  6. floam commented on Sep 24, 2021

    @floam
    MemberAuthor

    It's wacky "default" can't return the user to the default prompt on both sides, and I suggest we find a way to prevent users entering these weird intermediate states shown in my screenshot while trying prompts. It should be possible to distinguish a right prompt selected in fish_config from a fish_prompt function a user saved on their own, and/or possible to set a uvar with the prompt name selected and source the prompt's .fish file on launch rather than actually funcsave it perhaps, if it is important that we do preserve right prompts between changes.

  7. floam commented on Sep 24, 2021

    @floam
    MemberAuthor

    I guess I won't reapply the bug label. What do other @fish-shell/contributors think?

  8. faho commented on Sep 24, 2021

    @faho
    Member

    It's a UX nightmare.

    Awww, come on, that's a tad dramatic.

  9. floam commented on Sep 24, 2021

    @floam
    MemberAuthor

    We could prompt the user and ask them if they would like to affect both sides, yes or no.

  10. faho commented on Sep 24, 2021

    @faho
    Member

    Oh please no, constant prompts are also awkward.

    Especially given that we'd want this to be available in config.fish, and then it would have to isatty, and how do you then do it in config.fish?

  11. floam commented on Sep 24, 2021

    @floam
    MemberAuthor

    As it is, the user needs to find and delete a function or file to actually switch back to something else after trying a prompt that provides both left and right, that's kinda awkward.

  12. floam commented on Sep 24, 2021

    @floam
    MemberAuthor

    Especially given that we'd want this to be available in config.fish

    Why?

  13. floam commented on Sep 24, 2021

    @floam
    MemberAuthor

    It does a funcsave just like the HTML interface, correct? That should not be necessary.

  14. faho commented on Sep 24, 2021

    @faho
    Member

    Really, my case for keeping whatever right prompt is this:

    1. It's easier to write
    2. It allows you to set a right prompt, then pick a left prompt to go with it, to augment it. Or even, yes, to pick the right prompt from one and leave it?
    3. Erasing the right prompt or setting it after is easy
    4. If you're just doing it interactively, you can always simply restart the shell. That's easy and fixes everything, so we want to encourage it.

    I'm sorry, but I really don't enjoy having things I worked hard on, months ago, that were open for comments for a while then, to be called "a UX nightmare".

    Especially given that we'd want this to be available in config.fish

    Why?

    So you can do fish_config prompt choose disco, and it will select the disco prompt, and keep tracking the new version! We've had issues with the old one sticking around.

    Plus there is literally no reason not to.

    It does a funcsave just like the HTML interface, correct? That should not be necessary.

    choose does not. It simply sources, temporarily. That's what save is for.

  15. floam commented on Sep 24, 2021

    @floam
    MemberAuthor

    So you can do fish_config prompt choose disco, and it will select the disco prompt, and keep tracking the new version!

    I do think tracking the newest version is valuable, but I don't really think we want to require people to make a configuration file. How about remembering the prompt name in a uvar and setting it in one of our initialization functions if the user hasn't customized it? Kinda like keybindings.

    I'm sorry, I didn't mean to be rude. I don't really know the history of this feature. I'm glad a CLI interface to the web config is being added.

  16. floam commented on Sep 24, 2021

    @floam
    MemberAuthor

    choose does not. It simply sources, temporarily. That's what save is for.

    Hm, ok. I was unaware. How about try?

  17. faho commented on Sep 24, 2021

    @faho
    Member

    How about remembering the prompt name in a uvar and setting it in one of our initialization functions if the user hasn't customized it?

    We... uh, want to move away from uvars (#7379).

    That's also much more brittle and annoying than, you know, simply doing the same thing.

  18. faho commented on Sep 24, 2021

    @faho
    Member

    Hm, ok. I was unaware. How about try?

    I'm sorry, that would have been great months ago before it was released in fish 3.3.0. I do not want to change this or add another name for it now.

  19. mqudsi commented on Sep 24, 2021

    @mqudsi
    Contributor

    Could we just have default specify an empty right prompt with the logic that choosing the default is akin to resetting? I do think the current behavior is a tad confusing in that regard, since you don't end up with what you might intuitively expect the "default" to be after that operation. It would preserve the current behavior for any other prompt, so it's a bit of a compromise.

  20. faho commented on Sep 26, 2021

    @faho
    Member

    Could we just have default specify an empty right prompt with the logic that choosing the default is akin to resetting?

    That's inconsistent and I don't think running

    fish_config prompt choose disco # or another prompt with a right component
    fish_config prompt choose default # to reset it
    fish_config prompt choose nim # a prompt without a right component

    is super intuitive.

  21. faho commented on Sep 26, 2021

    @faho
    Member

    Let's just do the thing that apparently other people think is better.

    I still don't agree, but I don't have a desire to squabble over minutia like this.

  22. added a commit that references this issue on Dec 12, 2021
  23. locked as resolved and limited conversation to collaborators on Sep 26, 2022
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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions