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

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

Closed
nagisa opened this issue May 15, 2017 · 5 comments
Closed

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

nagisa opened this issue May 15, 2017 · 5 comments

Comments

@nagisa
Copy link
Contributor

nagisa commented May 15, 2017

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)
@therealpxc
Copy link
Contributor

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

@therealpxc
Copy link
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).

@therealpxc
Copy link
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.)

@therealpxc
Copy link
Contributor

there's a fix in this commit: 183082c

Mic92 pushed a commit that referenced this issue May 22, 2017
Mic92 pushed a commit that referenced this issue May 22, 2017
@Mic92 Mic92 closed this as completed May 22, 2017
@therealpxc
Copy link
Contributor

therealpxc commented May 22, 2017 via email

adrianpk added a commit to adrianpk/nixpkgs that referenced this issue May 31, 2024
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

No branches or pull requests

3 participants