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

added option programs.bash.promptInit #1025

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

christian-burger
Copy link

Option is identical to NixOS option. Default value copied from there.

Motivation: I know zsh is default in macOS. But every time you enter nix develop, there is only a rudimentary prompt by default. Plus, on older MacBooks some people might not have transitioned to zsh, yet. Both zsh as well as fish provide this option as well.

Only problem is: This might break things for people using programs.bash.interactiveShellInit or environment.interactiveShellInit to configure their prompt, because it gets overwritten as I imitated the way it is implemented in the zsh module. I could, alternatively to the way it is done now,

  1. move it up, so that it is executed during shell initialization before said option. Or
  2. provide a warning in the module, that alerts the user of the interactiveShellInit option to the change the next time they run darwin-rebuild.

Though the latter is more consistent with expected behaviour in my opinion, it will have to be removed after some grace period.

Copy link
Collaborator

@Enzime Enzime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preference would be if this more closely matched the logic in NixOS i.e. setting programs.bash.interactiveShellInit to contain programs.bash.promptInit and run it before config.environment.interactiveShellInit

https://github.com/NixOS/nixpkgs/blob/17726c73ffacc0eb7b739446d40d8a79ad7c8ef2/nixos/modules/programs/bash/bash.nix#L114-L142

Option is identical to NixOS option. Default value copied from there.
@christian-burger christian-burger force-pushed the new-option-programs.bash.promptInit branch from 27ca329 to e17a15e Compare January 7, 2025 09:45
@christian-burger
Copy link
Author

Okay, you mean like this? Because to me your request makes the most sense if all commands meant for interactive shells are put there. 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants