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

This plugin breaks globalias #31

Closed
Sciencentistguy opened this issue Jan 20, 2022 · 9 comments
Closed

This plugin breaks globalias #31

Sciencentistguy opened this issue Jan 20, 2022 · 9 comments
Labels
bug Something isn't working Linux MacOS

Comments

@Sciencentistguy
Copy link

Issue description

https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/globalias is a plugin that exapnds aliases when you press space.

Having this plugin loaded breaks the functionality of that.

Interestingly, when in a nix-shell it starts to work again.

This persists under a home-manager installation on darwin-aarch64, and a manual "just source the plugin file" installation on (arch)linux-x86_64 (and darwin-aarch64).

Steps to reproduce

  1. Install both plugins
  2. Observe it not working

Technical details

Please run the following commands and paste the results:

  1. command nix-shell -p nix-info --run "nix-info -m"

  2. zsh --version

 - system: `"aarch64-darwin"`
 - host os: `Darwin 21.2.0, macOS 12.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.5.1`
 - channels(jamie): `"darwin, home-manager"`
 - channels(root): `"darwin, home-manager, nixpkgs-22.05pre346058.bc59ba15b64"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
  1. zsh 5.8 (aarch64-apple-darwin20.1.0)
@chisui chisui added bug Something isn't working Linux MacOS labels Jan 22, 2022
@chisui
Copy link
Owner

chisui commented Jan 22, 2022

I could not reproduce this issue. Here is my home-manager zsh config:

{
  programs.zsh = {
    enable = true;
    enableCompletion = true;
    plugins = with pkgs.nur.repos.chisui.zsh-plugins; [
      zsh-nix-shell
    ];
    oh-my-zsh = {
      enable = true;
      plugins = [ "git" "globalias" ];
    };
  };
}

At least {1..4} expands to 1 2 3 4.

How are you installing the zsh-nix-shell exactly?

@Sciencentistguy
Copy link
Author

I source the .plugin.zsh file from the .zshrc, which is exactly what home-manager' generated zshrc does

@chisui
Copy link
Owner

chisui commented Jan 22, 2022

Relevant parts of my generated .zshrc:

path+="$HOME/.zsh/plugins/zsh-nix-shell"
fpath+="$HOME/.zsh/plugins/zsh-nix-shell"

plugins=(git, globalias)
source $ZSH/oh-my-zsh.sh

if [[ -f "$HOME/.zsh/plugins/zsh-nix-shell/nix-shell.plugin.zsh" ]]; then
  source "$HOME/.zsh/plugins/zsh-nix-shell/nix-shell.plugin.zsh"
fi

It seems that the plugin is added to path and fpath, which shouldn't be necessary. Does adding the plugin dir to path and/or fpath fix your issue?

@Sciencentistguy
Copy link
Author

No it doesn't, unfortunately

@chisui
Copy link
Owner

chisui commented Jan 22, 2022

Hm, maybe the order matters? Do you have any other plugins active? Could you post your .zshrc?

@Sciencentistguy
Copy link
Author

It's in here: https://github.com/Sciencentistguy/dotfiles

@chisui
Copy link
Owner

chisui commented Jan 22, 2022

Does it work move globalias below the zsh-nix-shell source?

@Sciencentistguy
Copy link
Author

Oh that does fix it thanks!

I wonder why that is?

Sciencentistguy added a commit to Sciencentistguy/dotfiles that referenced this issue Jan 22, 2022
See: chisui/zsh-nix-shell#31

Also update globalias from upstream.
@chisui
Copy link
Owner

chisui commented Jan 22, 2022

globalias seems to do some special stuff. I have no idea what. To be honest, I don't plan to support that in this plugin. So if that fixes your issue I'll close this one.

@chisui chisui closed this as completed Jan 22, 2022
Sciencentistguy added a commit to Sciencentistguy/dotfiles that referenced this issue Jan 25, 2022
See: chisui/zsh-nix-shell#31

Also update globalias from upstream.
Sciencentistguy added a commit to Sciencentistguy/dotfiles that referenced this issue Jan 25, 2022
See: chisui/zsh-nix-shell#31

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

No branches or pull requests

2 participants