Skip to content

fish: environment.shellAliases are not available in non-login shell #25800

Closed

Description

@nagisa

Issue description

Fish usually has environment.shellAliases available, but the aliases are now missing, when the shell is not a login shell (presumably because of #24314).

Steps to reproduce

Have

  environment.shellAliases = {
      lsa = "${pkgs.coreutils}/bin/ls -lahFT0 --group-directories-first";
  };

Then launch fish as a not-login shell. Try to use lsa.

Technical details

  • System: 17.09pre107265.0afb6d789c (Hummingbird)

Activity

  1. therealpxc commented on May 15, 2017

    @therealpxc
    Contributor

    Agh, what a mess. Thanks for raising this issue.

  2. therealpxc commented on May 16, 2017

    @therealpxc
    Contributor

    I think this issue is a little subtler than one would think: aliases are sourced, but only when the parent shell has not already sourced the interactive configuration.

    This is out of line with the behavior of the other shells on NixOS. I have a fix which I've tested with your example here. I will post a link to the relevant PR momentarily (after I put it up).

  3. therealpxc commented on May 16, 2017

    @therealpxc
    Contributor

    So apparently outgoing SSH is blocked from the WiFi on this cruise ship, so I can't push commits with the remotes I have set up, and my sister is nagging me to get off the computer so we can go out. If you need a quick fix on your own machine (I will be back later today, while I still have internet access, to submit the new PR), just change the set -gx <...> lines in the NixOS module for fish (/nixos/modules/programs/fish.nix) to set -g <...> and your aliases will get sourced every time the shell starts, so changes will be reflected without a reboot or manually unsetting the relevant variable before starting a new shell (set -e __fish_nixos_interactive_config_sourced).

    (The latter will do the trick if you want a quick fix without any changes to your Nixpkgs tree.)

  4. therealpxc commented on May 16, 2017

    @therealpxc
    Contributor

    there's a fix in this commit: 183082c

  5. therealpxc commented on May 22, 2017

    @therealpxc
    Contributor
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions