zsh-users
 help / color / mirror / code / Atom feed
* zsh sometimes freezes when completing a command
@ 2010-03-15 10:15 Vincent Lefevre
  2010-03-15 15:58 ` Bart Schaefer
  0 siblings, 1 reply; 9+ messages in thread
From: Vincent Lefevre @ 2010-03-15 10:15 UTC (permalink / raw)
  To: zsh-users

For instance:

patate:~/wd/tmd/oldtests[255]> cront[TAB]

has frozen, and it isn't possible to interrupt it (with either Ctrl-C
or Ctrl-\). This is with zsh 4.3.8 (I'll recompile the latest version).

FYI, here's my $cdpath: . /home/vlefevre ..

I've run gdb on the current process. Here's the backtrace:

(gdb) bt
#0  0x00007fe80de60b1f in poll () from /lib/libc.so.6
#1  0x00007fe80853811d in ldap_result () from /usr/lib/libldap_r-2.4.so.2
#2  0x00007fe808772d8e in ?? () from /lib/libnss_ldap.so.2
#3  0x00007fe808773069 in ?? () from /lib/libnss_ldap.so.2
#4  0x00007fe808774d75 in _nss_ldap_endpwent () from /lib/libnss_ldap.so.2
#5  0x00007fe80de7923b in __nss_endent () from /lib/libc.so.6
#6  0x00007fe80de36c2a in endpwent () from /lib/libc.so.6
#7  0x000000000042c025 in ?? ()
#8  0x00007fe805c5d5e4 in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/parameter.so
#9  0x000000000042cde8 in scanmatchtable ()
#10 0x000000000042ce19 in scanhashtable ()
#11 0x000000000044b9f1 in paramvalarr ()
#12 0x000000000044bad8 in ?? ()
#13 0x000000000044bb9d in getarrvalue ()
#14 0x00007fe8055fb20d in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#15 0x00007fe8055fdf6b in addmatches ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#16 0x00007fe8055f8279 in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#17 0x0000000000415f85 in execbuiltin ()
#18 0x0000000000422863 in ?? ()
#19 0x000000000042391c in ?? ()
#20 0x0000000000423d00 in ?? ()
#21 0x0000000000424be9 in execlist ()
#22 0x000000000043e33b in execif ()
#23 0x00000000004221f5 in ?? ()
#24 0x000000000042391c in ?? ()
#25 0x0000000000423d00 in ?? ()
#26 0x0000000000424bd5 in execlist ()
#27 0x000000000043e59f in execwhile ()
#28 0x00000000004221f5 in ?? ()
#29 0x000000000042391c in ?? ()
#30 0x0000000000423d00 in ?? ()
#31 0x0000000000424bd5 in execlist ()
#32 0x0000000000424d25 in execode ()
#33 0x0000000000424e0f in runshfunc ()
#34 0x00007fe8055f640a in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#35 0x0000000000424dc5 in runshfunc ()
#36 0x00000000004251af in doshfunc ()
#37 0x00000000004253e2 in ?? ()
#38 0x00000000004227a2 in ?? ()
#39 0x000000000042391c in ?? ()
#40 0x0000000000423d00 in ?? ()
#41 0x0000000000424be9 in execlist ()
#42 0x000000000043e59f in execwhile ()
#43 0x00000000004221f5 in ?? ()
#44 0x000000000042391c in ?? ()
#45 0x0000000000423d00 in ?? ()
#46 0x0000000000424bd5 in execlist ()
#47 0x0000000000424d25 in execode ()
#48 0x0000000000424e0f in runshfunc ()
#49 0x00007fe8055f640a in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#50 0x0000000000424dc5 in runshfunc ()
#51 0x00000000004251af in doshfunc ()
#52 0x00000000004253e2 in ?? ()
#53 0x00000000004227a2 in ?? ()
#54 0x000000000042391c in ?? ()
#55 0x0000000000423d00 in ?? ()
#56 0x0000000000424bd5 in execlist ()
#57 0x0000000000424d25 in execode ()
#58 0x0000000000425beb in ?? ()
#59 0x00000000004221f5 in ?? ()
#60 0x000000000042391c in ?? ()
#61 0x0000000000423d00 in ?? ()
#62 0x0000000000424bd5 in execlist ()
#63 0x0000000000424d25 in execode ()
#64 0x0000000000424e0f in runshfunc ()
#65 0x00007fe8055f640a in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#66 0x0000000000424dc5 in runshfunc ()
#67 0x00000000004251af in doshfunc ()
#68 0x00000000004253e2 in ?? ()
#69 0x00000000004227a2 in ?? ()
#70 0x000000000042391c in ?? ()
#71 0x0000000000423d00 in ?? ()
#72 0x0000000000424be9 in execlist ()
#73 0x000000000043e59f in execwhile ()
#74 0x00000000004221f5 in ?? ()
#75 0x000000000042391c in ?? ()
#76 0x0000000000423d00 in ?? ()
#77 0x0000000000424bd5 in execlist ()
#78 0x0000000000424d25 in execode ()
#79 0x0000000000425beb in ?? ()
#80 0x00000000004221f5 in ?? ()
#81 0x000000000042391c in ?? ()
#82 0x0000000000423d00 in ?? ()
#83 0x0000000000424bd5 in execlist ()
#84 0x0000000000424d25 in execode ()
#85 0x0000000000424e0f in runshfunc ()
#86 0x00007fe8055f640a in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#87 0x0000000000424dc5 in runshfunc ()
#88 0x00000000004251af in doshfunc ()
#89 0x00000000004253e2 in ?? ()
#90 0x00000000004227a2 in ?? ()
#91 0x000000000042391c in ?? ()
#92 0x0000000000423d00 in ?? ()
#93 0x0000000000424bd5 in execlist ()
#94 0x000000000043e59f in execwhile ()
#95 0x00000000004221f5 in ?? ()
#96 0x000000000042391c in ?? ()
#97 0x0000000000423d00 in ?? ()
#98 0x0000000000424bd5 in execlist ()
#99 0x000000000043e33b in execif ()
#100 0x00000000004221f5 in ?? ()
#101 0x000000000042391c in ?? ()
#102 0x0000000000423d00 in ?? ()
#103 0x0000000000424bd5 in execlist ()
#104 0x000000000043e33b in execif ()
#105 0x00000000004221f5 in ?? ()
#106 0x000000000042391c in ?? ()
#107 0x0000000000423d00 in ?? ()
#108 0x0000000000424bd5 in execlist ()
#109 0x000000000043effb in execfor ()
#110 0x00000000004221f5 in ?? ()
#111 0x000000000042391c in ?? ()
#112 0x0000000000423d00 in ?? ()
#113 0x0000000000424bd5 in execlist ()
#114 0x000000000043e59f in execwhile ()
#115 0x00000000004221f5 in ?? ()
#116 0x000000000042391c in ?? ()
#117 0x0000000000423d00 in ?? ()
#118 0x0000000000424bd5 in execlist ()
#119 0x0000000000424d25 in execode ()
#120 0x0000000000424e0f in runshfunc ()
#121 0x00007fe8055f640a in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#122 0x0000000000424dc5 in runshfunc ()
#123 0x00000000004251af in doshfunc ()
#124 0x00000000004253e2 in ?? ()
#125 0x00000000004227a2 in ?? ()
#126 0x000000000042391c in ?? ()
#127 0x0000000000423d00 in ?? ()
#128 0x0000000000424be9 in execlist ()
#129 0x000000000043e33b in execif ()
#130 0x00000000004221f5 in ?? ()
#131 0x000000000042391c in ?? ()
#132 0x0000000000423d00 in ?? ()
#133 0x0000000000424bd5 in execlist ()
#134 0x000000000043e33b in execif ()
#135 0x00000000004221f5 in ?? ()
#136 0x000000000042391c in ?? ()
#137 0x0000000000423d00 in ?? ()
#138 0x0000000000424bd5 in execlist ()
#139 0x0000000000424d25 in execode ()
#140 0x0000000000424e0f in runshfunc ()
#141 0x00007fe8055f640a in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#142 0x0000000000424dc5 in runshfunc ()
#143 0x00000000004251af in doshfunc ()
#144 0x00000000004253e2 in ?? ()
#145 0x00000000004227a2 in ?? ()
#146 0x000000000042391c in ?? ()
#147 0x0000000000423d00 in ?? ()
#148 0x0000000000424c4b in execlist ()
#149 0x0000000000424d25 in execode ()
#150 0x0000000000425beb in ?? ()
#151 0x00000000004221f5 in ?? ()
#152 0x000000000042391c in ?? ()
#153 0x0000000000423d00 in ?? ()
#154 0x0000000000424bd5 in execlist ()
#155 0x0000000000424d25 in execode ()
#156 0x0000000000424e0f in runshfunc ()
#157 0x00007fe8055f640a in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#158 0x0000000000424dc5 in runshfunc ()
#159 0x00000000004251af in doshfunc ()
#160 0x00000000004253e2 in ?? ()
#161 0x00000000004227a2 in ?? ()
#162 0x000000000042391c in ?? ()
#163 0x0000000000423d00 in ?? ()
#164 0x0000000000424bd5 in execlist ()
#165 0x0000000000424d25 in execode ()
#166 0x000000000040ed62 in bin_eval ()
#167 0x0000000000415f85 in execbuiltin ()
#168 0x0000000000422863 in ?? ()
#169 0x000000000042391c in ?? ()
#170 0x0000000000423d00 in ?? ()
#171 0x0000000000424be9 in execlist ()
#172 0x000000000043e33b in execif ()
#173 0x00000000004221f5 in ?? ()
#174 0x000000000042391c in ?? ()
#175 0x0000000000423d00 in ?? ()
#176 0x0000000000424bd5 in execlist ()
#177 0x0000000000424d25 in execode ()
#178 0x0000000000424e0f in runshfunc ()
#179 0x00007fe8055f640a in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#180 0x0000000000424dc5 in runshfunc ()
#181 0x00000000004251af in doshfunc ()
#182 0x00000000004253e2 in ?? ()
#183 0x00000000004227a2 in ?? ()
#184 0x000000000042391c in ?? ()
#185 0x0000000000423d00 in ?? ()
#186 0x0000000000424be9 in execlist ()
#187 0x000000000043e33b in execif ()
#188 0x00000000004221f5 in ?? ()
#189 0x000000000042391c in ?? ()
#190 0x0000000000423d00 in ?? ()
#191 0x0000000000424bd5 in execlist ()
#192 0x0000000000424d25 in execode ()
#193 0x0000000000424e0f in runshfunc ()
#194 0x00007fe8055f640a in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#195 0x0000000000424dc5 in runshfunc ()
#196 0x00000000004251af in doshfunc ()
#197 0x00000000004253e2 in ?? ()
#198 0x00000000004227a2 in ?? ()
#199 0x000000000042391c in ?? ()
#200 0x0000000000423d00 in ?? ()
#201 0x0000000000424bd5 in execlist ()
#202 0x000000000043e2c6 in execif ()
#203 0x00000000004221f5 in ?? ()
#204 0x000000000042391c in ?? ()
#205 0x0000000000423d00 in ?? ()
#206 0x0000000000424bd5 in execlist ()
#207 0x000000000043effb in execfor ()
#208 0x00000000004221f5 in ?? ()
#209 0x000000000042391c in ?? ()
#210 0x0000000000423d00 in ?? ()
#211 0x0000000000424bd5 in execlist ()
#212 0x000000000043effb in execfor ()
#213 0x00000000004221f5 in ?? ()
#214 0x000000000042391c in ?? ()
#215 0x0000000000423d00 in ?? ()
#216 0x0000000000424bd5 in execlist ()
#217 0x0000000000424d25 in execode ()
#218 0x0000000000424e0f in runshfunc ()
#219 0x00007fe8055f640a in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#220 0x0000000000424dc5 in runshfunc ()
#221 0x00000000004251af in doshfunc ()
#222 0x00007fe8055ff335 in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#223 0x00007fe805600346 in do_completion ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/complete.so
#224 0x00007fe80593d1f3 in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/zle.so
#225 0x00007fe80593fb82 in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/zle.so
#226 0x00007fe80593b160 in completecall ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/zle.so
#227 0x00007fe80592e0e6 in execzlefunc ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/zle.so
#228 0x00007fe80593ac9d in ?? ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/zle.so
#229 0x0000000000415f85 in execbuiltin ()
#230 0x0000000000422863 in ?? ()
#231 0x000000000042391c in ?? ()
#232 0x0000000000423d00 in ?? ()
#233 0x0000000000424bd5 in execlist ()
#234 0x000000000043e33b in execif ()
#235 0x00000000004221f5 in ?? ()
#236 0x000000000042391c in ?? ()
#237 0x0000000000423d00 in ?? ()
#238 0x0000000000424bd5 in execlist ()
#239 0x0000000000424d25 in execode ()
#240 0x0000000000424e0f in runshfunc ()
#241 0x00000000004251af in doshfunc ()
#242 0x00007fe80592df88 in execzlefunc ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/zle.so
#243 0x00007fe80592e391 in zlecore ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/zle.so
#244 0x00007fe80592e99c in zleread ()
   from /home/vlefevre/x86_64/lib/zsh/4.3.8/zsh/zle.so
#245 0x0000000000432bef in zleentry ()
#246 0x0000000000435d64 in ingetc ()
#247 0x000000000043183a in ?? ()
#248 0x000000000043ca38 in yylex ()
#249 0x00000000004561c7 in parse_event ()
#250 0x00000000004347b2 in loop ()
#251 0x00000000004354c6 in zsh_main ()
#252 0x00007fe80ddb81a6 in __libc_start_main () from /lib/libc.so.6
#253 0x000000000040ddca in _start ()

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zsh sometimes freezes when completing a command
  2010-03-15 10:15 zsh sometimes freezes when completing a command Vincent Lefevre
@ 2010-03-15 15:58 ` Bart Schaefer
  2010-03-16  0:13   ` Vincent Lefevre
  0 siblings, 1 reply; 9+ messages in thread
From: Bart Schaefer @ 2010-03-15 15:58 UTC (permalink / raw)
  To: zsh-users

On Mar 15, 11:15am, Vincent Lefevre wrote:
} Subject: zsh sometimes freezes when completing a command

Zsh sometimes becomes uninterruptible when completing anything that
takes a long time to look up.  We probably ought to install a special
handler for INT, QUIT, and TSTP during completion (or any ZLE op that
executes as a shell function rather than as a builtin).

} I've run gdb on the current process. Here's the backtrace:
} 
} (gdb) bt
} #0  0x00007fe80de60b1f in poll () from /lib/libc.so.6
} #1  0x00007fe80853811d in ldap_result () from /usr/lib/libldap_r-2.4.so.2

So what's causing the "freeze" is that zsh is waiting for the LDAP
server to time out.  The part about not being able to interrupt it
is an unintended side-effect.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zsh sometimes freezes when completing a command
  2010-03-15 15:58 ` Bart Schaefer
@ 2010-03-16  0:13   ` Vincent Lefevre
  2010-03-16  1:54     ` Bart Schaefer
  0 siblings, 1 reply; 9+ messages in thread
From: Vincent Lefevre @ 2010-03-16  0:13 UTC (permalink / raw)
  To: zsh-users

On 2010-03-15 08:58:20 -0700, Bart Schaefer wrote:
> } I've run gdb on the current process. Here's the backtrace:
> } 
> } (gdb) bt
> } #0  0x00007fe80de60b1f in poll () from /lib/libc.so.6
> } #1  0x00007fe80853811d in ldap_result () from /usr/lib/libldap_r-2.4.so.2
> 
> So what's causing the "freeze" is that zsh is waiting for the LDAP
> server to time out.

It seems to never time out. I suspect a bug. This occurs from time to
time. After zsh has frozen, I can do the same completion from another
zsh instance on the same machine, and the completion is immediate.

I have:

zstyle ':completion:*:complete:-command-:*' tag-order 'commands builtins functions aliases suffix-aliases reserved-words jobs parameters' '*'

and the complete help says:

tags in context :completion::complete:-command-::
    commands executables builtins functions aliases suffix-aliases reserved-words jobs parameters  (_alternative _command_names _autocd (eval)) 
    commands                                                                                       (_path_commands _alternative _command_names _autocd (eval)) 
    jobs                                                                                           (_jobs _alternative _command_names _autocd (eval)) 
    parameters                                                                                     (_parameters _alternative _command_names _autocd (eval)) 
    named-directories                                                                              (_alternative _cd _autocd (eval)) 
    users named-directories directory-stack                                                        (_tilde _alternative _cd _autocd (eval)) 
    users                                                                                          (_users _tilde _alternative _cd _autocd (eval))

I wonder why zsh tries to complete on users.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zsh sometimes freezes when completing a command
  2010-03-16  0:13   ` Vincent Lefevre
@ 2010-03-16  1:54     ` Bart Schaefer
  2010-03-16  3:50       ` Vincent Lefevre
  0 siblings, 1 reply; 9+ messages in thread
From: Bart Schaefer @ 2010-03-16  1:54 UTC (permalink / raw)
  To: zsh-users

On Mar 16,  1:13am, Vincent Lefevre wrote:
}
} tags in context :completion::complete:-command-::
} 
} I wonder why zsh tries to complete on users.

Targets for autocd, I suspect.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zsh sometimes freezes when completing a command
  2010-03-16  1:54     ` Bart Schaefer
@ 2010-03-16  3:50       ` Vincent Lefevre
  2010-03-16  4:11         ` Andrey Borzenkov
  2010-03-16  5:35         ` Benjamin R. Haskell
  0 siblings, 2 replies; 9+ messages in thread
From: Vincent Lefevre @ 2010-03-16  3:50 UTC (permalink / raw)
  To: zsh-users

On 2010-03-15 18:54:15 -0700, Bart Schaefer wrote:
> On Mar 16,  1:13am, Vincent Lefevre wrote:
> } tags in context :completion::complete:-command-::
> } 
> } I wonder why zsh tries to complete on users.
> 
> Targets for autocd, I suspect.

Yes. But can't these targets be disabled for completion, or used only
if the other completions failed?

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zsh sometimes freezes when completing a command
  2010-03-16  3:50       ` Vincent Lefevre
@ 2010-03-16  4:11         ` Andrey Borzenkov
  2010-03-16  9:32           ` Vincent Lefevre
  2010-03-16  5:35         ` Benjamin R. Haskell
  1 sibling, 1 reply; 9+ messages in thread
From: Andrey Borzenkov @ 2010-03-16  4:11 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: Text/Plain, Size: 481 bytes --]

On Tuesday 16 of March 2010 06:50:49 Vincent Lefevre wrote:
> On 2010-03-15 18:54:15 -0700, Bart Schaefer wrote:
> > On Mar 16,  1:13am, Vincent Lefevre wrote:
> > } tags in context :completion::complete:-command-::
> > }
> > } I wonder why zsh tries to complete on users.
> > 
> > Targets for autocd, I suspect.
> 
> Yes. But can't these targets be disabled for completion, or used only
> if the other completions failed?

Does it do it also after "unsetopt autocd"?

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zsh sometimes freezes when completing a command
  2010-03-16  3:50       ` Vincent Lefevre
  2010-03-16  4:11         ` Andrey Borzenkov
@ 2010-03-16  5:35         ` Benjamin R. Haskell
  2010-03-16 13:58           ` Bart Schaefer
  1 sibling, 1 reply; 9+ messages in thread
From: Benjamin R. Haskell @ 2010-03-16  5:35 UTC (permalink / raw)
  To: zsh-users

On Tue, 16 Mar 2010, Vincent Lefevre wrote:

> On 2010-03-15 18:54:15 -0700, Bart Schaefer wrote:
> > On Mar 16,  1:13am, Vincent Lefevre wrote:
> > } tags in context :completion::complete:-command-::
> > } 
> > } I wonder why zsh tries to complete on users.
> > 
> > Targets for autocd, I suspect.
> 
> Yes. But can't these targets be disabled for completion, or used only 
> if the other completions failed?

>From a similar discussion w/ subject: 'Avoid LDAP hit during 
completion'[1], Peter's suggestion lead me tangentially to this section, 
from somewhere in zshall (zstyle(?) .. Standard styles):

users  This may be set to a list of usernames to be completed.   If  it
	   is  not set all usernames will be completed.  Note that if it is 
	   set only that list of users will be completed; this  is  because 
	   on some systems querying all users can take a prohibitive amount 
	   of time.

E.g.: The following sets '~user' expansion to only use 'bhaskell' and 
'dovecot' (random selection from my system):

zstyle ':completion:*' users {bhaskell,dovecot}

(OT: also surprised me to realize I have 30 'named directories' at this 
point... ls ~<TAB> shows 32 items.)

As pws explained in much more detail in that thread, that might not be 
the only place users would be generated.  But, things also may have been 
cleaned up since 2005.

And, you might also be better served changing this at a different level.  
(Zsh isn't the only thing that can trigger a listing of usernames.)  My 
work computer is a Linux machine joined to a Windows Domain, and ls 
~<Tab> didn't trigger any slowness.  My Samba configuration there 
(/etc/samba/smb.conf) has the following settings:

winbind enum users = No
winbind enum groups = No
winbind separator = .

getent passwd doesn't return the DOMAIN.username entries (due to the 
'No' enum), but they're still perfectly usable as normal(-ish) system 
users.  (I can log in as DOMAIN.bhaskell via SSH, for example.)

Changing those lines got me back to slowness.  (But even 280 domain 
users doesn't take terribly long to enumerate there.)

-- 
Best,
Ben

[1] http://www.zsh.org/mla/users/2005/msg00659.html


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zsh sometimes freezes when completing a command
  2010-03-16  4:11         ` Andrey Borzenkov
@ 2010-03-16  9:32           ` Vincent Lefevre
  0 siblings, 0 replies; 9+ messages in thread
From: Vincent Lefevre @ 2010-03-16  9:32 UTC (permalink / raw)
  To: zsh-users

On 2010-03-16 07:11:26 +0300, Andrey Borzenkov wrote:
> On Tuesday 16 of March 2010 06:50:49 Vincent Lefevre wrote:
> > On 2010-03-15 18:54:15 -0700, Bart Schaefer wrote:
> > > On Mar 16,  1:13am, Vincent Lefevre wrote:
> > > } tags in context :completion::complete:-command-::
> > > }
> > > } I wonder why zsh tries to complete on users.
> > > 
> > > Targets for autocd, I suspect.
> > 
> > Yes. But can't these targets be disabled for completion, or used only
> > if the other completions failed?
> 
> Does it do it also after "unsetopt autocd"?

No, but in fact, these targets seem to be due to the combination
of AUTO_CD and CD_ABLE_VARS. AUTO_CD is useful for me. But I can
disable CD_ABLE_VARS, which I no longer need, AFAIK.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zsh sometimes freezes when completing a command
  2010-03-16  5:35         ` Benjamin R. Haskell
@ 2010-03-16 13:58           ` Bart Schaefer
  0 siblings, 0 replies; 9+ messages in thread
From: Bart Schaefer @ 2010-03-16 13:58 UTC (permalink / raw)
  To: zsh-users

On Mar 16,  1:35am, Benjamin R. Haskell wrote:
} 
} From a similar discussion w/ subject: 'Avoid LDAP hit during 
} completion'[1], Peter's suggestion lead me tangentially to this section, 
} from somewhere in zshall (zstyle(?) .. Standard styles):
} 
} users  This may be set to a list of usernames to be completed.   If  it
} 	   is  not set all usernames will be completed.  Note that if it is 
} 	   set only that list of users will be completed; this  is  because 
} 	   on some systems querying all users can take a prohibitive amount 
} 	   of time.

Hmm, ramifications of this that didn't sink in before have just occurred
to me.  One can set the style with "zstyle -e" to cause an eval at the
time of lookup, and therefore control the mechanism by which user lookup
is peformed (use an external app for LDAP, for example).

I don't have a clever example to offer just now, but food for thought.
 
} As pws explained in much more detail in that thread, that might not be 
} the only place users would be generated.  But, things also may have been 
} cleaned up since 2005.

Users are generated by expanding a reference to the "userdirs" variable
defined in the zsh/parameter module.  This happens in these locations:

_users in which case the zstyle suppresses the userdirs reference; 
_expand when expanding any word that begins with tilde;
_chown when completing the user to whom to assign ownership;
_mailboxes when completing abbreviated mailbox names for mush or zmail;
_tilde_files when completing ~someuser/somepath...

Plus any completion loaded via the bashcompinit compatibility package
that runs "compgen -A users".

The _tilde_files case is interesting because if completing ~someuser
(without the trailing path) it calls _users and obeys the style.  The
userdirs reference with the trailing path is always $userdirs[$user]
to confirm that user home directory exists, so perhaps that doesn't
trigger an expensive lookup or a large result set.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-03-16 13:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-15 10:15 zsh sometimes freezes when completing a command Vincent Lefevre
2010-03-15 15:58 ` Bart Schaefer
2010-03-16  0:13   ` Vincent Lefevre
2010-03-16  1:54     ` Bart Schaefer
2010-03-16  3:50       ` Vincent Lefevre
2010-03-16  4:11         ` Andrey Borzenkov
2010-03-16  9:32           ` Vincent Lefevre
2010-03-16  5:35         ` Benjamin R. Haskell
2010-03-16 13:58           ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).