You are not logged in.

#1 2023-10-29 12:26:30

RodAlc
Member
Registered: 2023-10-29
Posts: 2

[SOLVED] zsh is not completing sudo commands

I have zsh, configured with grml-zsh-config. I also have a .zshrc file with a very minimal configuration.

The completion used to work well, but know it doesn't work with sudo commands. I mean that if you type `sudo pacman -` and tab, instead of printing all possible options (-S, -F, -R...) it tries to complete with files. However `pacman -` and tab works perfectly well. It happens to all sudo commands.

I have removed zsh-completions, grml-zsh-config and it didn't fix it. I have also reinstalled zsh with the same result.

I know that if I delete .zshrc the completion works perfectly well, but I need my configuration. Even if .zshrc is completely empty the completion does not work well.

I have tried to solve it for some time, but I din`t find anything useful.

Last edited by RodAlc (2023-10-30 08:40:13)

Offline

#2 2023-10-30 05:14:58

Markus00000
Member
Registered: 2011-03-27
Posts: 333

Re: [SOLVED] zsh is not completing sudo commands

Same issue suddenly occurred here. I haven’t changed my configuration recently.

I’ll let you know if I find a solution.

Offline

#3 2023-10-30 08:10:03

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,068

Re: [SOLVED] zsh is not completing sudo commands

How "recently"?
/usr/share/zsh/functions/Completion/Unix/_sudo is provided by zsh which saw the last update in July, grml-zsh-config (using that as well?) in June.

I know that if I delete .zshrc the completion works perfectly well, but I need my configuration. Even if .zshrc is completely empty the completion does not work well.

Errr… WHAT?
1. the grml zshr will also source  $HOME/.zshrc.pre and $HOME/.zshrc.local, so you might utilize those, however:
2. post everything /etc/zsh* and ~/.zsh* - if the mere presence OF THE EMPTY FILE impacts the behavior, this suggest something™ checks for it and aborts at this point.

Does either of you use something stupid like OMZ?

Offline

#4 2023-10-30 08:37:09

RodAlc
Member
Registered: 2023-10-29
Posts: 2

Re: [SOLVED] zsh is not completing sudo commands

I have solved it.
It was nothing related to zsh, it was kitty terminal setting an alias to sudo. I just needed to configure `shell_integration no-sudo` in kitty.conf and everything works well.
I hope it helps you Markus

(And no, I don't use OMZ)

Offline

#5 2023-10-30 09:01:00

Markus00000
Member
Registered: 2011-03-27
Posts: 333

Re: [SOLVED] zsh is not completing sudo commands

Much appreciated!

For posterity:

# kitty.conf
shell_integration no-sudo

See docs and closed issue on GitHub.

Offline

#6 2023-10-30 12:17:29

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,727

Re: [SOLVED] zsh is not completing sudo commands

I would say the real fix here is to dump kitty. Any upstream who thinks this is the right thing to do is not one you should use.

Offline

#7 2023-10-30 14:37:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,068

Re: [SOLVED] zsh is not completing sudo commands

I was about to say that VTE does likewise dumb shit, but it's actually not /that/ dumb:
https://github.com/kovidgoyal/kitty/com … 6533ab04d2

And believe it or not, their faq actually explains the proper approach to this
https://github.com/kovidgoyal/kitty/com … 0da562448d
https://sw.kovidgoyal.net/kitty/faq/#i- … don-t-work

Not entirely sure how the existing ~/.zshrc becomes relevant or why kitty depends on $TERMINFO, but either way:
It causes an undisputable bug that you want to report upstream and while it's entirely not the TE's job to "fix" the users shell, the proper approach for any of this is a drop-in in /etc/sudoers.d

Offline

Board footer

Powered by FluxBB