Skip to content

fish_config prompt save prompt_name retains the previous right prompt #10675

@abhbh

Description

@abhbh

Issue

If I activate a prompt (which doesn't have a right prompt) using fish_config prompt save prompt_name , the fish_right_prompt.fish still contains the previous right prompt. Ideally it should be cleared or deleted.

Test Envionment

Fish

fish, version 3.7.0 from Ubuntu 24.04 repository as well as fish, version 3.7.1 from the PPA

Terminal

TERM=xterm-256color

Fresh Fish

sh -c 'env HOME=$(mktemp -d) XDG_CONFIG_HOME= fish' doesn't fix it.

Reproducing the problem

In the screenshot below:

  1. I first activated disco prompt which has both left and right prompt. It gets activated correctly.
  2. Activate pythonista prompt which doesn't have a right prompt. As it can be seen that the prompt is still there and the fish_right_prompt.fish file contains the function from disco prompt.
  3. Activate default prompt. Same issue.

Screenshot 2024-08-19 100313

Expected Behaviour

If a prompt.fish file doesn't include function fish_right_prompt(), fish_config prompt save should clear the fish_right_prompt.fish file.

Workaround

Activating a prompt using fish_config prompt choose prompt_name and then fish_config prompt save works as expected.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions