fish: remove promptInit in favor of interactiveShellInit (#2231)

* fish: remove `promptInit` in favor of `interactiveShellInit`

* Oops

* starship: replace `promptInit` with `interactiveShellInit`

* autojump: replace `promptInit` with `interactiveShellInit`

* Add `mkRemovedOptionModule` for `programs.fish.promptInit`
This commit is contained in:
Kid 2021-10-28 06:40:39 +08:00 committed by GitHub
parent 46a69810cb
commit 9282dbc1fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 13 deletions

View file

@ -49,7 +49,7 @@ in {
. ${package}/share/autojump/autojump.zsh
'';
programs.fish.promptInit = mkIf cfg.enableFishIntegration ''
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
. ${package}/share/autojump/autojump.fish
'';
};

View file

@ -146,6 +146,16 @@ let
(mapAttrsToList (k: v: "alias ${k} ${escapeShellArg v}") cfg.shellAliases);
in {
imports = [
(mkRemovedOptionModule [ "programs" "fish" "promptInit" ] ''
Prompt is now configured through the
programs.fish.interactiveShellInit
option. Please change to use that instead.
'')
];
options = {
programs.fish = {
enable = mkEnableOption "fish, the friendly interactive shell";
@ -214,14 +224,6 @@ in {
initialisation.
'';
};
promptInit = mkOption {
type = types.lines;
default = "";
description = ''
Shell script code used to initialise fish prompt.
'';
};
};
programs.fish.plugins = mkOption {
@ -365,9 +367,6 @@ in {
# Aliases
${aliasesStr}
# Prompt initialisation
${cfg.promptInit}
# Interactive shell intialisation
${cfg.interactiveShellInit}

View file

@ -102,7 +102,7 @@ in {
fi
'';
programs.fish.promptInit = mkIf cfg.enableFishIntegration ''
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
if test "$TERM" != "dumb" -a \( -z "$INSIDE_EMACS" -o "$INSIDE_EMACS" = "vterm" \)
eval (${starshipCmd} init fish)
end