Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: BUG: completion suddenly broken in Debian



On Mon, Mar 31, 2025 at 3:01 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>
> On 2025-03-30 05:48:37 +0200, Vincent Lefevre wrote:
> > I've just reported the following bug:
> >
> >   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1101675
> >
> > With "zsh -f":
> >
> > qaa% mkdir testdir
> > qaa% touch testdir/FOO
> > qaa% autoload -U compinit
> > qaa% compinit
> > qaa% zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}'
> > qaa% : testdir/f
> >
> > If I try to complete "testdir/f", I get no matches.
> >
> > On an older machine, I get "testdir/FOO" as expected.
> >
> > I suspect that some package upgrade broke completion (I can only
> > see libcap2).
>
> Indeed, this comes from the new python3-argcomplete Debian package.
>
> I noticed a similar issue in the past few weeks (or months?), where
> I needed to type <tab> twice to get the expected completion on this
> machine. I didn't have the time to look at the cause. But now it
> appears that this also came from this package.

We've had people come into the irc channel with this/similar problems
for at least a year, and it's been reported upstream and to package
maintainers, it's unbelievable that a maintainer would still add this
garbage to a user's system at this point. Attaching an unfiltered
output of grep -C25 python-argcomplete \#zsh.log for reference (not
all hunks will be relevant).

-- 
Mikael Magnusson
22:47 <llua> apparently unset 'commands[cmd]' is how you remove a entry from the command hash table
22:49 <llua> > hash -L ls; unset 'commands[ls]'; hash -L ls
22:49 <machabot> llua: /dev/stdin:1: commands: assignment to invalid subscript range
--- Day changed Mon Mar 20 2023
00:44 -!- BH24 is now known as BH23
03:32 -!- Lord_of_Life_ is now known as Lord_of_Life
04:38 -!- cdown_ is now known as cdown
04:39 <Xeroine> llua: kinda late response but thanks
04:41 <Xeroine> oh i get the same invalid subscript range error
04:51 <llua> would have to use zmodload zsh/parameter or reference $commands for it to load implicitly before it works
08:34 <jmcantrell> i'm trying to use _values to generate completion for a command. the choices for _values comes from a command that produces lines of the form "name_without_spaces description with spaces". the user should be able to pick one or more of the items from the lines. i want to show both the name and the description (or maybe just the description if that's easier), but i the item that needs to complete is the name_without_spaces. how can i describe this to
08:34 <jmcantrell> _values?
08:40 <osse> jmcantrell: if I'm reading this right, _values want 'value[description]' 'value[description]' 
08:41 <jmcantrell> maybe. i'm wondering if _describe might be the best fit after a little reading
08:41 <osse> try this: lines=(${(f)"$(command here)"}); _values "some overall description here" ${${lines/ /[}/#/]}
08:41 <jmcantrell> ok
09:13 <jmcantrell> osse: thank you
09:13 <osse> did it work as hoped?
09:32 <jmcantrell> eventually yes. turned out the lines were delimited with tabs and not spaces
09:32 <Mikachu> usually lines are delimited with newlines ;)
09:33 <jmcantrell> sorry, i misspoke. the lines are delimited with newlines, but on each line, the name/description was delimited with tabs
09:47 <osse> ah
11:55 -!- feto_bastardo3 is now known as feto_bastardo
12:18 <maledictium> Hi guys. Sorry for the ignorant question but what is bashcompinit and what is it used for?
12:20 <maledictium> ok, disregard my questions, it's in the man page
12:42 <maledictium> So, I autoloaded and enabled the bashcompinit function but when I want to do something like: eval "$(register-python-argcomplete pipx)", it returns this error: complete:13: command not found: compdef
12:42 <maledictium> where should I be looking to fix this?
13:23 <llua> you want to run compinit before doing that
13:23 <llua> preferrably before bashcompinit
13:25 <susi> there's explanation for `bashcompinit' @ man zshcompsys
13:29 <FH_thecat> I need to call zcompile from a Makefile
13:29 <FH_thecat> so I am using: zsh -c 'zcompile xx.zwc xx'
13:30 <FH_thecat> but I noticed, the resulting file xx.zwc has different shasum than when I compile it normally with: 
13:30 <FH_thecat> zcompile xx.zwc xx
13:33 <FH_thecat> shouldn't the compiled file be identical ?
13:33 <maledictium> llua: Thanks! Spot on. I was running it (compinit) after. Now it works.
13:34 <FH_thecat> the filesize is the same, but the checksums are different
13:35 <llua> there isn't a promise of deterministic compilation
13:36 <FH_thecat> OK, but I get sam checksum if I call the same command repeatedly
13:37 <FH_thecat> so I am worried, I am doing something wrong when I use: zsh -c 'zcompile xx.zwc xx'
13:37 <llua> does it behave the same?
13:38 <llua> it being your function
13:38 <FH_thecat> how do I know, it there is some subtle difference, that will only manifest in special sitution
13:38 <llua> well, testing
13:41 <FH_thecat> OK, let me ask differently. Is this the correct way to call zcompile from makefile:  zsh -c 'zcompile xx.zwc xx' ?
13:43 <llua> its fine
13:49 <FH_thecat> so why does it create different file, then when I call zcompile directly ?
13:55 <nimaje> maybe small diffrences in the environment, that cause small unimportant changes in the result?
14:42 -!- ormaaaj is now known as Disingenuously
14:51 -!- Disingenuously is now known as ormaaaj
15:32 -!- Lord_of_Life_ is now known as Lord_of_Life
--
22:49 <Mikachu> (or $jobtexts)
22:53 <ToxicFrog> Hmm, it looks like when the process finishes its entry in $jobstates is changed to "done" but it is not pruned
22:54 <ToxicFrog> I guess I have to watch for them to change to "done" and then `wait` for them explicitly?
22:58 <ToxicFrog> Aha, just calling `jobs &>/dev/null` occasionally is enough.
22:58 <ToxicFrog> Mikachu: it's alive! Thank you.
23:49 <brocellous> I coulda sworn there was an option or something to disable those job notification messages
23:49 <brocellous> can't find one tho maybe I was hallucinating
23:50 <llua> the latter
--- Day changed Sat Jun 15 2024
00:02 <brocellous> Eh, hm for some reason completing filenames after > isn't working for me.
00:03 <Mikachu> someone mentioned some random debian package installed a broken completer
00:03 <Mikachu> what does _complete_debug say?
00:03 <brocellous> can't even get the _complete_help to show up when hitting TAB in that position...
00:03 <Mikachu> oh yeah i actually meant _complete_help
00:04 <brocellous> This is the debug output: https://paste.sr.ht/~brocellous/c8ac26b2329012b47018f2d16e6ab76f84d12e56
00:04 <Mikachu> echo $_comps[-redirect-] $_comps[-redirect-,-default-,-default-] what does this say
00:04 <Mikachu> _python_argcomplete_global: <- there's your problem
00:05 <Mikachu> that's the broken completer they mentioned
00:06 <brocellous> wrm yeah python there looks very sus
00:08 <llua> shitty polyglot shell completers
00:08 <brocellous> echo $_comps[-redirect-] $_comps[-redirect-,-default-,-default-] is "_redirect _files" which seems ok
00:09 <brocellous> I'ma see if I can't find that python thing dunnno where it comes from
00:09 <brocellous> very annoying
00:09 <Mikachu> if you echo $fpath it should be in the site-functions or vendor-functions dir
00:10 <brocellous> $functions_source finds it for me
00:10 <brocellous> python-argcomplete is a dep of python-jupyter-core ugh
00:11 <Mikachu> you can just delete the completer, or better yet file a bug so i don't have to answer this question a third time ;)
00:13 <brocellous> https://github.com/kislyuk/argcomplete/blob/80e5cb610de023caef2b12e583eb2b7be9015de6/argcomplete/bash_completion.d/_python-argcomplete#L1
00:15 <llua> lol -default- is crazy
00:17 <ToxicFrog> brocellous: `setopt nonotify` may be what you're thinking of, which disables the notifications when background jobs complete, but doesn't affect the notification when they start.
00:23 -!- cdown_ is now known as cdown
00:27 <brocellous> llua: believe it or not, that's the "fixed" version. This is what I've got: https://github.com/kislyuk/argcomplete/blob/v3.1.6/argcomplete/bash_completion.d/_python-argcomplete#L1
00:39 <Mikachu> that seems like insane code that nobody should ever use
00:39 <Mikachu> and certainly it should not be a global default
00:42 <Mikachu> i think debian packager wasn't paying attention to what the package does
00:42 <Mikachu> the github seems to imply that this would not be the default mode of operation
00:44 <brocellous> this is basically malware
01:31 <FreeBDSM> why does `top; Ctrl+z; bg; jobs -l` list the 'top' job as suspended? shouldn't `bg` have resumed it in the background?
01:33 <llua> no
01:34 <llua> if its still expecting input from an a tty anyway.
01:34 <FreeBDSM> then I got misled by https://github.com/nelhage/reptyr?tab=readme-ov-file#typical-usage-pattern
01:34 <FreeBDSM> thanks
01:49 <llua> nuking the magic comment and letting people opt into it via compdef() would be saner, like _gnu_generic
01:51 <llua> well, changing it to #autoload
02:04 -!- cdown_ is now known as cdown
03:33 -!- cdown_ is now known as cdown
11:42 -!- katia is now known as mmmmmmmmmmmmmmmm
11:45 -!- mmmmmmmmmmmmmmmm is now known as iakat
12:06 -!- iakat is now known as katia
14:02 -!- kvn_ is now known as kvn
14:18 <mali> hi. how would I comdbine (shortgllob is on)   **(D) and **(-.) ? i.e.  I wish to list symlinks to files but not to dirs, and also hidden files 
14:19 <mali> looks like it might have been (-D.) lol. nvm me
14:19 <mali> hm could swear it didn't do that a minute ago but it does :)
14:20 <osse> *(@-D.) perhaps? Or do you want to list non-symlinks too as long as they're files?
14:33 <mali> yes osse. the symlinked files too, but the (-D.) did the trick thanks.
14:33 <mali> I just had tried it a few minsn ago, asked in here, tried again. and meh, it worked , after all :)
16:52 -!- jensen is now known as aDYA
--
18:56 <fiveof> i'll try to hack it around a bit later, but thanks. very useful, especially the colour docs.
19:36 <ToxicFrog> For the SGR codes -- note that not all are supported by all terminals, and the 256 and RGB codes in particular have at least four different variations in syntax across terminals
19:36 <ToxicFrog> The ANSI and AIX palettes are generally safe, though
19:39 <ToxicFrog> I also wonder if you could get away with something like: zle -M "$(print -nP "%F{magenta}hello")"
19:39 <ToxicFrog> (not actually tested)
19:39 <Mikachu> no, the output is escaped
19:40 <ToxicFrog> Aaw
19:40 <fiveof> actually on the syntax
19:42 <fiveof> i was hoping for a good read for the list-color syntax as well. it's *very* arcane; "'=(#b) #([0-9]#)*( *[a-z])*=34=31=33'" type stuff.
19:44 <Mikachu> see "Colored completion listings" in the manpage
19:44 <fiveof> oh right there huh. ok.
19:44 <ToxicFrog> It's the same as LS_COLORS, IIRC, not that I can read that off the cuff either
19:45 <fiveof> oh!
19:45 <Mikachu> only for file listings
19:45 <Mikachu> you can eg color columns differently in the ps output used for process completion too
19:45 <fiveof> for some reason my LS_COLORS is empty. is that typical? probably handled by some plugin instead.
19:46 <llua> its pattern matching on the display strings outside of the context of filename completion.
19:46 <Mikachu> it is not set if you don't set it, normally dircolors is used for this
19:47 <ToxicFrog> Sorry, by "same as" I meant "same concept/syntax" (or at least very similar), not "same value"
19:48 <Mikachu> same answer
19:49 <ToxicFrog> And yeah, usually you set LS_COLORS by having a dircolors database (or using the default one that comes with dircolors), then running dircolors to get a shell fragment that, when evaluated, set LS_COLORS to something that matches the contents of the database, and then ls(1) uses it.
19:49 <llua> gnu ls(1)
20:08 -!- Lord_of_Life_ is now known as Lord_of_Life
21:20 -!- intelfx_ is now known as intelfx
22:45 <nejni-marji> Is there a reason I can't tab complete files for redirection anymore? eg, I want to run `< file.json jq` and i used to be able to type `< fi` and tab complete it
22:45 <Mikachu> uninstall the broken debian package python-argcomplete
22:46 <Mikachu> and if possible contact the maintainers
22:46 <nejni-marji> thanks
22:47 <nejni-marji> pipx depends on that, but i don't actually need pipx to be installed unless i'm using it, so i guess it's fine to remove it
22:47 <Mikachu> you can also just install the completer file that belongs to that package
22:47 <Mikachu> uninstall*
22:47 <Mikachu> eg, rm
22:51 <Mikachu> it's anyway fundamentally broken to have some random python package depend on a package that changes basic functionality of zsh
22:59 <nejni-marji> seems like it's allegedly fixed in a future version of the package, and it's already flagged out of date on arch's repos as of about 3 weeks ago
23:00 <nejni-marji> anyway at least i can just remove the completer
23:00 <Mikachu> ah, so it's not just debian then?
23:00 <Mikachu> you're the 3rd with the problem now
23:02 <nejni-marji> it's definitely known on their end, they merged a fix for it in november
23:03 <Mikachu> idk if the "fix" actually fixes it, the code still looks crazy
23:03 <Mikachu> but i certainly haven't tired it
23:04 <nejni-marji> i did say "allegedly fixed" the first time... i mean, i hope, but
23:04 <Mikachu> right
23:15 -!- moony8922 is now known as moony
23:15 <henk> hi, I want to have env vars like EDITOR und LC_* set when logging in on a getty and when logging in in a display manager. what’s the correct way to do that? use ~/.profile and source it both in ~/.xsession and ~/.zprofile?
23:16 <Mikachu> i have a .xenv file i source from where it's needed
23:16 <Mikachu> but i use startx, not a dm
23:16 <Mikachu> not sure if there is a more canonical way
23:20 <henk> I also use startx on my home computer. tried that on my work computer and ran into issues, with gpg-agent in particular: it wasn’t able to show pinentry. I figure it’s because the work computer uses systemd and starts gpg-agent on login, while my home computer uses sysvinit and starts gpg-agent with startx, so the initial tty is different. there are other problems, with both pulseaudio and
23:20 <henk> pipewire, which may be caused by that same mechanism, so I’m considering just using a DM on that machine.
23:21 <henk> Mikachu: any particular reason you don’t use .profile? or source your .zprofile?
23:22 <Mikachu> yeah
23:22 <Mikachu> .zprofile has zsh-specific code and i believe startx uses /bin/sh
23:22 <Mikachu> .profile is a bash file
23:23 <Mikachu> and my x environment has stuff i may not want in normal login shells
23:25 <henk> ah ok, thanks
23:31 <brocellous> Mikachu: I filed https://github.com/kislyuk/argcomplete/issues/491 for that project with the insane completer. Didn't really care to address any shortcoming in the code, but hopefully can make nothing touch it by default.
23:51 <brocellous> Hopefully we can fix the Arch package in a shorter timeframe https://gitlab.archlinux.org/archlinux/packaging/packages/python-argcomplete/-/issues/3
--- Day changed Tue Jun 18 2024
00:45 -!- hyperreal8 is now known as hyperreal
01:33 <llua> hm, the mla isn't being archived at the moment i think
01:34 <llua> can't find the thread "Superfluous completion for noglob"
01:35 <llua> oh, just google being shit
03:05 <llua> https://github.com/kislyuk/argcomplete/issues/491#issuecomment-2174711855 heh
03:08 <Mikachu> that's what i found when i read their docs too
12:02 <cheater> i have a program that can only output to a path, not to stdout. can zsh somehow trick it to write to stdout anyways?
12:17 <vuori> Does it work if you tell it to output to /dev/stdout
12:41 <llua> redirect the fd it does write to, to fd1
13:36 -!- Lord_of_Life_ is now known as Lord_of_Life
13:36 -!- ccxwrk_ is now known as ccxwrk
13:36 -!- masterkorp0 is now known as masterkorp
13:36 -!- InFerNo__ is now known as InFerNo_
13:48 -!- Roy_Mustang is now known as A_Dragon
13:57 <cheater> oh i didn't know about /dev/stdout, thanks
14:00 <Mikachu> if it expects to be able to seek in the output file the program may be disappointed
14:04 <llua> heh, i totally read the question wrong
14:11 -!- cdown_ is now known as cdown
14:16 <cheater> how do i fake watch in zsh with a loop? i tried while :; do cat foo; sleep 1; done but that doesn't work
14:17 <osse> cheater: might want a clear before cat
14:18 <cheater> well the problem is that if i do that then all i get is
14:18 <osse> apart from that it should work
14:18 <cheater> !/bin/zsh
14:18 <cheater> 1
--
02:01 <FreeBDSM> the man clearly states that > Initially, there are eight keymaps: emacs, viins, vicmd, viopp, visual, isearch, command and .safe <
02:02 <Mikachu> it also clearly states: When the editor starts up, it will select the `main' keymap.
02:02 <FreeBDSM> aha, now T prints 'main'
02:06 <FreeBDSM> aaaah, so `bindkey -v` and `-bindkey -e` indeed leave the mode 'main', they just add links for emacs/viins to main
02:08 <FreeBDSM> confused again: > To use a newly created keymap, it should be linked to main.  Hence the sequence of commands to create and use a new keymap `mymap' initialized from the emacs keymap (which remains unchanged) is: `bindkey -N mymap emacs && bindkey -A mymap main` <
02:08 <FreeBDSM> so the mode will ALWAYS be 'main'?
02:08 <FreeBDSM> s/mode/keymap/g
02:09 <Mikachu> by default the active keymap is 'main' when zle starts
02:09 <FreeBDSM> right, but how to switch it?
02:11 <FreeBDSM> only via deleting 'main' and thus falling back to .safe?
02:13 <FreeBDSM> looks like that, because the man page only suggests that I can make an alias for main to some keymap
02:13 <FreeBDSM> and now I have a deja vu
02:14 <FreeBDSM> I think I had a conversation exactly about that issue on this channel some years ago (here or on freenode)
02:14 <Mikachu> if you're in bindkey -v, then pressing escape will set the active keymap to vicmd
02:16 <FreeBDSM> it works very shitty, those 'i' and 'n' get finally printed, but they get correctly printed (or re-printed) only after executing a command, they don't get updated upon switching between normal and insert modes
02:17 <FreeBDSM> or I don't understand something. in vim you can't print stuff when in normal mode
02:18 <FreeBDSM> normal mode is command mode, it's for typing vim commands like :w or :q
02:18 <FreeBDSM> and in ZLE I can type in both normal and insert modes
02:20 <FreeBDSM> so Esc-n switches to normal mode and then I press enter - a new ZLE starts up and it draws 'n' to indicate normal mode, YET I can type 'ls' and hit enter to execute `ls` as if I'm in insert mode
02:20 <FreeBDSM> yet if I don't press enter - the indicator works correctly: Esc enters normal mode, pressing 'i' after that - switches to insert and indicator changes to 'i' as well
02:21 <FreeBDSM> looks like a bug
07:27 <e1f> btw, bill joy was working on a modeless vi. but there was a system crash and the backups were corrupted and he didn't bother re-starting
10:07 -!- rvalue- is now known as rvalue
12:29 -!- tec5 is now known as tec
15:00 <pantaker> When I type `grep PATTERN < FILE` the auto completion after the angle bracket does not work, it used to work but now it does not. Here is my config: https://privatebin.net/?1ee1c618ec98b2b5#QhuM6WNg1Ypcd5chhfGNESN3sFZZ2AdEXs353VcVXMi Also deleting everything related to completion seems to make it work again
15:01 <llua> do you have some python-argcomplete package installed?
15:03 <pantaker> yes
15:03 <pantaker> although I don't remember installing it
15:03 <Mikachu> do we need to nuke this from orbit?
15:03 <llua> update it if possible
15:03 <pantaker> alright
15:04 <pantaker> it is up to date
15:05 <llua> nuke the completer it provides then
15:05 <llua> its malware like
15:06 <pantaker> so I should remove it?
15:06 <llua> just removing the completer is fine, the package was prob needed by something on your system
15:07 <pantaker> It is needed
15:07 <pantaker> but I don't know what you mean by 'removing the completer'
15:07 <llua> what os are you on?
15:07 <pantaker> Linux
15:08 <llua> which distro?
15:08 <pantaker> Manjaro
15:09 <llua> in /usr/share/zsh/site-functions/ there is going to be a file name _python-something
15:09 <llua> with the first line #compdef -default-
15:11 <pantaker> I found the sneaky fella, by a name of '_python-argcomplete'
15:11 <llua> delete that
15:12 <pantaker> yup everything is back to normal
15:12 <pantaker> Thank you, have a nice day!
15:12 <llua> now add that file to NoExtract in your pacman.conf
15:13 <Mikachu> https://gitlab.archlinux.org/archlinux/packaging/packages/python-argcomplete/-/issues/3 says it should be fixed, but maybe it takes a while to trickle down from arch to manjaro?
15:14 <llua> yeah, it does
15:15 <pantaker> So it's a known issue, huh
15:16 -!- emanuele6 is now known as Guest8131
15:17 <pantaker> Yes it appears that the manjaro package is a bit behind the newest version, well at least it will fix itself by default at some point
15:17 <pantaker> Thanks again
15:18 <llua> they usually are
15:18 <pantaker> How interesting
15:21 <llua> !python
15:21 <machabot> While bash and zsh have a common subset, they are distinct languages. You cant generally run a #!/bin/bash script in zsh, nor vice versa. (Just like you cant run a #!/usr/bin/python script in Perl.)
15:23 <llua> !define pyargcomplete packagers of python-argcomplete may install a completer that overrides the _default behavior of zsh compsys. remove the file ''echo $^fpath/*~*/_default(Ne*'sed 1q $REPLY | grep -q -- "#compdef -default-"'*)'' to fix your file completion
15:23 <machabot> llua: Ok!
15:27 <llua> !undefine pyargcomplete
15:27 <machabot> llua: Ok!
15:27 <llua> !define pyargcomplete packagers of python-argcomplete may install a completer that overrides the _default behavior of zsh compsys. remove the file ''echo $^fpath/_*~*/_default(Ne*'sed 1q $REPLY | grep -q -- "#compdef -default-"'*)'' to fix your filename completion
15:27 <machabot> llua: Ok!
15:28 <Soliton> perl is a bad example since it will actually read the shebang and call python.
15:29 <llua> i thought it was a bad example just now due to the lack of a common subset too, i made it a long time ago
15:30 <llua> !undefine python
15:30 <machabot> llua: Ok!
15:31 <llua> i don't remember using it in quite awhile so it isn't needed
15:33 <nimaje> C and C++? but they are probably to similar
15:50 <susi__> danske & svenska?
18:36 <osse> sjovt bajs
21:51 <birkoff> why can't I do: exec { cmd1 || cmd2 }  ?
21:57 <llua> { isn't a external utility
21:58 <llua> nor does exec returns if you were expecting magical made up syntax to work
22:06 <phy1729> How could it work
22:07 <phy1729> If you replace the shell with cmd1, there's nothing left to check the exit status and possibly run cmd2
22:12 <henk> birkoff: what’s the goal?
22:14 <birkoff> exec accepts command, and { .. }  is a complex command
22:14 <birkoff> so I thought
22:15 <llua> { is a compound command
22:15 <llua> /complex, correct
22:15 <birkoff> henk: replace the running script with a command, if that command returns failure run the other command
22:17 <llua> need to keep a parent around for supervision.
22:17 <phy1729> birkoff: how would you answer my question
22:26 <birkoff> well then ( ... ) doesnt work either and it's ran in a subshell
22:28 <llua> exec accepts a simple command
22:30 <birkoff> where does it say it ?
--
19:49 <Sampersand> what's that?
19:49 <llua> the completion system
19:49 <Sampersand> oh comppletion system. how does one bootstrap that
19:50 <llua> the same way you do in your startup files
19:50 <Sampersand> i dont do anything in startup files; i suspect that work has done something which is why it works
19:50 <Sampersand> ill delve more into the work setup files! thanks!
19:51 <larryv> https://zsh.sourceforge.io/Doc/Release/Completion-System.html#Initialization
19:51 <Sampersand> <3 thanks. i still have yet to learn about the completion system, i think i should do that next!
20:51 -!- jensen1 is now known as aqtn
--- Day changed Fri Nov 01 2024
03:38 -!- emanuelespooky is now known as emanuele6
06:00 -!- TheGhoulOnTheHil is now known as FoH
06:34 -!- rvalue- is now known as rvalue
08:47 -!- Lord_of_Life_ is now known as Lord_of_Life
11:09 <emanuele6> % paste -sd' ' /etc/shells
12:48 -!- rvalue- is now known as rvalue
16:01 -!- jensen1 is now known as asze
17:30 -!- rex_victor is now known as rex
22:38 <ectospasm> I have an issue with completion after the input redirection character, '<'.  I've seen this in zsh on macOS and Arch Linux, and I'm sure there's some completion function or widget that isn't configured.
22:39 <Mikachu> python-argparse?
22:39 <ectospasm> Most often I do this with `pbcopy < <TAB>` to show files in the current directory
22:40 <ectospasm> pbcopy is a standard CLI program on macOS;  I've mapped it to `xclip -selection clipboard` on Linux (tried aliases, shell functions, and a named zsh script)
22:41 <ectospasm> (pbcopy takes stdin and puts it in the pasteboard/clipboard)
22:41 <Mikachu> oops i remembered the name wrong
22:41 <Mikachu> !pyargcomplete
22:41 <machabot> packagers of python-argcomplete may install a completer that overrides the _default behavior of zsh compsys. remove the file ''echo $^fpath/_*~*/_default(Ne*'sed 1q $REPLY | grep -q -- "#compdef -default-"'*)'' to fix your filename completion
22:41 <Mikachu> that's certainly one way to do it
22:44 <ectospasm> Is there a way I can show the current _default?  I assume I'm not supposed to include the double single-quotes that stated, and it didn't work immediately.
22:44 <ectospasm> I'm not all too familiar with zshcompsys, I did scan through the man page for it and didn't find anything.
22:45 <ectospasm> But I just searched for 'input redirection' and '<' (the latter gave unrelated results)
22:46 <ectospasm> So, filename completion isn't broken usually, just after that redirection (not sure if knows to ignore the `pbcopy`)
22:46 <Mikachu> your symptoms exactly match what happens if you have the proken pyargparse completer installed so i figured i'd try that first
22:47 <ectospasm> (I've also seen it on a second argument to diff -u file1 file2`, it won't complete file2, but that's only on macOS which I'm not on right now)
22:48 <ectospasm> It doesn't seem to be limited to `pbcopy`.  It also doesn't work with `cat` (`cat 2<TAB>` works, `cat < 2<TAB>` doesn't)
22:49 <ectospasm> It should at least complete to 2024-10-3, since I have two files in the current directory, one starting with 2024-10-30, the other with 2024-10-31
22:51 <ectospasm> (and it may work OK on macOS, I'm not really sure since that one is at work)
22:52 <Mikachu> can you check echo $^fpath/_python-argcomplete(N)
23:07 <ectospasm> Mikachu: /usr/local/share/zsh/site-functions/_python-argcomplete
23:08 <Mikachu> delete that file and you should be good to go
23:08 <ectospasm> Will that break the Python completion though?  I have found it nice that some Python scripts allow me to complete the arguments.
23:11 <ectospasm> I did remove it, and that did *NOT* fix it. neither `pbcopy < <TAB>` nor `cat < <TAB>` seem to work.  The last `echo` command now shows an empty line instead.
23:11 <ectospasm> So this doesn't appear to be caused by _python-argcomplete
23:12 <ectospasm> I'm going to restore that file.
23:12 <ectospasm> Is there a way to list completers?
23:18 <Mikachu> did you open a new shell?
23:18 <ectospasm> Oh, I didn't do that.  Let me try again.
23:19 <ectospasm> Ahh, yep, that was it.
23:19 <ectospasm> Good catch.
23:20 <Mikachu> haven't had someone come in here with that problem in a while, thought all distros had fixed it by now
23:20 <Mikachu> then again it was in /usr/local so i guess you installed it manually?
23:20 <ectospasm> I do not remember, it's possible.
--- Day changed Sat Nov 02 2024
01:06 <Mikachu> ectospasm: forgot to answer one question, echo $_comps[-default-]
03:30 <brocellous> The last version of _python-argcomplete shipped to site-functions in Arch still had `#compdef -P *` instead of `#compdef -default-`
03:32 <brocellous> which is even more destructive
08:18 -!- sham1_ is now known as sham1
08:48 -!- Lord_of_Life_ is now known as Lord_of_Life
15:55 -!- jensen1 is now known as aui
--- Day changed Sun Nov 03 2024
02:57 -!- jensen1 is now known as ayag
04:42 <emanuele6> join #gentoo-base,#italy,#italia
04:43 <emanuele6> oops
04:48 <llua> you ruined the day of quietness
05:37 -!- birk0ff is now known as birkoff
06:47 <FH_thecat> I have this in my .zshrc:
06:47 <FH_thecat>  zstyle ':completion:*:*:*:*:directories' ignored-patterns 'lost+found|*/lost+found'
06:47 <FH_thecat>  fignore=(lost+found)
06:47 <FH_thecat> but still, when I do cd completion, it offers me lost+found
08:47 -!- Lord_of_Life_ is now known as Lord_of_Life
12:58 -!- rvalue- is now known as rvalue
14:10 <Mikachu> FH_thecat: try local-directories instead of directoreis
14:11 <Mikachu> invoke _complete_help at "cd <cursor>" and it will show you the completion context
14:29 <susi> hmm what amma missin that ctrl-x does not open the 'execute:' subprompt
14:29 <susi> it's `bindkey -v' but I don't think I used to need to do any manual binding for it
14:29 <Mikachu> alt-x
14:30 <susi> it neither works
14:32 <llua> you did in viins. since its bound to : in vicmd, not at all in viins.
14:34 <susi> yeah, danke
15:27 -!- jensen1 is now known as apq
--
07:01 <awdv> -D doesn't work though 
07:01 <awdv> wait
07:01 <awdv> works without -c always (color always), nice
07:02 <awdv> i can live without colors
08:13 -!- Lord_of_Life_ is now known as Lord_of_Life
15:25 -!- cdown_ is now known as cdown
18:13 -!- jensen1 is now known as augf
19:02 -!- jensen1 is now known as axyq
22:12 -!- kentucky44424366 is now known as kentucky4442436
--- Day changed Sun Mar 09 2025
02:36 -!- PcaLfU3d1 is now known as PcaLfU3d
04:20 -!- cdown_ is now known as cdown
16:23 -!- cdown_ is now known as cdown
16:32 -!- Juan is now known as Guest4014
19:55 -!- jensen1 is now known as azxx
22:06 <Maarrk> Hi, would it be possible to have a compiled executable offer its own zsh completions? All resources I found focus on writing shell scripts, which I'd like to avoid as much as possible
22:06 <Maarrk> I'm inspired by argcomplete Python package, so somehow it works, but maybe there's a resource I could look at instead of reverse engineering that library?
22:06 <Maarrk> Thanks in advance ^^
22:09 <llua> every implementation of that concept offers shitty completion since they avoid learning zsh's completion system
22:10 <llua> or shoehorn's bash's completion into zsh
22:11 <llua> or shoehorn's bash's completion paradigm* into zsh
22:11 <Maarrk> Would your suggestion be to learn it the (intended) scripting way, and afterwards do it for my program?
22:12 <Maarrk> Those are probably trivial questions, all I know is my own experience: <Tab> in zsh good, <Tab> everywhere else bad
22:16 <llua> sure, you would better understanding what your program would have to fart out into zsh to give users a idiomatic experience.
22:26 <Maarrk> well said, thanks
23:08 <brocellous> idk python-argcomplete is a special kind of shitty. Probably the worst implementation I'm aware of.
23:09 <brocellous> idk what libraries are available in go but I've seen a few go programs with passable generated completions.
23:10 <brocellous> I really only ask for the keywords/verbs, flags, and give them descriptions dammit. Obv there's more to "good" completions but beggars can't be choosers I guess.
23:10 <brocellous> And zshcompsys is admittedly pretty arcane
23:10 <brocellous> Don't blame authors for not trying so hard.
23:24 <llua> if your use of compsys is largely, press tab and stuff appear, i am sure the go programs generate completion you are fine with; in a way that haven't broken compsys, like python-argcomplete.
23:26 <llua> if you find being able to prevent `zfs destroy' from completing a important dataset, but `zfs snapshot/clone/w.e' can, those completers are ass.
23:27 <brocellous> They're all much worse than crafted completions, yeah.
23:34 <brocellous> I find most authors are happy to accept contributed completions, at least.
23:35 <brocellous> If they didn't have any, which is pretty common too.
23:35 <brocellous> Making a cli without completion is like a website without any links, and expecting users to navigate by copy-pasting curl commands. But people do it anyway.
23:45 <FoH> We're so spoiled these days.  :)
23:47 <FoH> The bourne shell that i learned on had no completion or history.
23:47 <FoH> And i had to type uphill, both ways.
23:56 <Maarrk> Even worse then punch cards - these had history
--- Day changed Mon Mar 10 2025
00:17 -!- pusher is now known as keypusher
03:15 -!- jensen1 is now known as aur
03:15 -!- aur is now known as aoav
08:13 -!- Lord_of_Life_ is now known as Lord_of_Life
14:34 -!- rvalue- is now known as rvalue
19:55 -!- jensen1 is now known as azqb
20:22 <Sampersand> wild idea: Now that `function -T xyz` is now valid syntax, how about `function -N` for `zle -N`?
20:30 <Sampersand> Hm i actually really like this idea lol
20:33 <Mikachu> zle -N foo; function $_ { echo hi }
20:52 <Sampersand> haha that's cursed!
21:16 -!- cdown_ is now known as cdown
22:08 <azqb> is syntax highlighting for a submcommand more awkward to determine compared to for a regular command, e.g. 'tmux' vs 'tmux kill-session'? fast-zsh-highlighting provides highlighting for the latter (syntax highlighting for subcommands) but isn't maintained. zsh-syntax-highlighting doesn't but is more customizable
22:47 <phy1729> subcommands are specific to the command. Commands are checkable via $+commands[tmux]
23:46 <Sampersand> other fun ideas for `function` arguments: `function -z foo` — add an implicit `emulate -L zsh` at the front; `function -N foo` — implicit `zle -N foo foo`; `function -U foo`—don't expand aliases within `foo`
23:47 <Mikachu> you can already do emulate zsh -c function ...


Messages sorted by: Reverse Date, Date, Thread, Author