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

setxkbmap: broken zsh completion #46025

Closed
teto opened this issue Sep 4, 2018 · 4 comments
Closed

setxkbmap: broken zsh completion #46025

teto opened this issue Sep 4, 2018 · 4 comments

Comments

@teto
Copy link
Member

teto commented Sep 4, 2018

Issue description

setxkbmap -                                                                                                                                                                                                                                              
_setxkbmap_files:6: no matches found: /symbols/**/*~*README(.)

Steps to reproduce

type "setxkbmap" then try to trigger completion with

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

  • system: "x86_64-linux"
  • host os: Linux 4.14.24, NixOS, 18.09.git.baa158d (Jellyfish)
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 2.0.4
  • nixpkgs: /home/teto/nixpkgs
@Ma27
Copy link
Member

Ma27 commented Sep 5, 2018

I can reproduce it on 18.09beta53.dea9a04ae6f (Jellyfish) with ZSH 5.6 (and oh-my-zsh inside which shouldn't be relevant).

I just had a short look through the commit log of zsh and the code is quit old, did it work before for you? (I'm just using setxkbmap in some personal shell scripts and quite rarely directly, so I can't tell if the completionactually worked). However the code of the completion in my /run/current-system seems quite broken for NixOS as it tries to search /usr directories, a behavior that should be patched accordingly.

I can try to fix it (didn't find further related issues ATM, let's see)...

@Ma27
Copy link
Member

Ma27 commented Sep 5, 2018

I just managed to get it working by adding substituteInPlace to the postInstall hook of the ZSH package locally. I'm not sure though if it's the best solution. Let me think if there's something better to do, otherwise I'd file a patch :)

@Ma27
Copy link
Member

Ma27 commented Sep 5, 2018

@teto would you mind having a look at this patch: Ma27@7299cd6

Will file it tomorrow, but I'm not sure, why not sure if there's a better way (don't like to manually specify setxkbmap in the zsh derivation).

@teto
Copy link
Member Author

teto commented Sep 6, 2018

yep it seems to have fixed it :)

Ma27 added a commit to Ma27/nixpkgs that referenced this issue Sep 20, 2018
Instead of searching `/usr` it should search for the `xkb`,
$XDG_DATA_DIRS will be searched. With this approach we allow compliance
on NixOS and non-NixOS systems to find `symbols` in the `xkb` directory.

The patch has been accepted by upstream, but isn't released yet, so this
is mainly a temporary fix until we can bump ZSH to the next stable version.

The `xserver` module links `/share/X11/xkb` to `/run/current-system` to
make this possible.

The fix can be tested inside the following VM:

```
{
  zshtest = {
    programs.zsh.enable = true;
    users.extraUsers.vm = {
      password = "vm";
      isNormalUser = true;
    };
    services.xserver.enable = true;
  };
}
```

Fixes NixOS#46025
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

2 participants