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

[Error] user-provided autoloaded fish_prompt is not loaded #1671

Open
capfredf opened this issue Jan 29, 2025 · 2 comments · May be fixed by #1672
Open

[Error] user-provided autoloaded fish_prompt is not loaded #1671

capfredf opened this issue Jan 29, 2025 · 2 comments · May be fixed by #1672
Labels
bug Something isn't working

Comments

@capfredf
Copy link

capfredf commented Jan 29, 2025

Please, before opening a bug:

  • make sure you've read the documentation.
  • Ensure there isn't already an open issue about this.
  • Ensure there isn't already a closed/resolved issue about this.

Describe the bug
e2ac35b has introduced a default prompt for fish shell. However, since the function is defined in a configure file, fish shell always load the function and ignore the user-provided autoloaded function fish_prompt, which is usually defined $XDG_CONFIG_HOME/fish/functions/fish_prompt.fish.

To Reproduce
have a fish_prompt.fish with the function defined in it.
launch distrobox with fish shell

Expected behavior
The prompt should be what the user defined, not the default prompt like

📦[$USER@$CONTAINER_ID $CURRENT_DIR]> 

Desktop (please complete the following information):
Aeon
podman version 5.3.2
distrobox: 1.8.0
preinstalled distro package

@injcristianrojas
Copy link

I see the same behavior.

Host OS: Fedora Silverblue 41.20250209.0
Distrobox version: 1.8.1.2
Currently using 3 guests (in all of them I see the same behavior using Fish Shell):

  • Fedora 41
  • Kali Linux
  • Ubuntu 24.04

@schuhumi
Copy link

So that was some unexpected behaviour that had me clueless for a while....

The file overriding the the prompt in the container is /etc/fish/conf.d/distrobox_config.fish , and due to the order that fish loads them it overrides what the user in their home directory. It seems to me that if a file with the same name exists in both the home directory and /etc, it is loaded from the home directory and skipped in /etc. Hence my dirty workaround is this:

~/.config/fish/conf.d/distrobox_config.fish:

if test -e /etc/fish/conf.d/distrobox_config.fish
	echo "Loading distrobox fish config"
	source /etc/fish/conf.d/distrobox_config.fish
	echo "Overwriting prompt by user's choice"
	source $XDG_CONFIG_HOME/fish/conf.d/fish_prompt.fish
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants