From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1358 invoked by alias); 15 Aug 2018 17:55:03 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23584 Received: (qmail 28101 invoked by uid 1010); 15 Aug 2018 17:55:02 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf1-f45.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.167.45):SA:0(-1.9/5.0):. Processed in 1.409696 secs); 15 Aug 2018 17:55:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_PASS,T_DKIMWL_WL_MED,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Xk9cFRpOTKdQ4r05AmvpDzupWVCBVrwyHU+qRyrhzJc=; b=kiCOt1LdZjbUijrqtZ9xtDa3+WUc8q47vCgu75/+djnicYm2caXR4Ed72KwTdAaOdh jVa9x2w0tvGXCkidwZr/1XTbAlsEEDP2iGNWr00YWOFSEYEr1snSP/dT4SuE9ly2PJ9x 2Y1CPJaVfVo8XSYvPnZdAQe6PkLgHqp7MU32VsSbdnBPMJIhLxrPfr2s8oUPeeupMWen AFh92fotu6VlCFDQOgFDC0KAC5h7XYquF9S0/iL5wmH4dpgs/xy8kaxCRX2sXUIuTCYE PoTbL+qbmxnP96og6FRXW3mwet1PpLLXs5fnkY4s7TPKd/RPXadutEi+Y2NobJfXdGjk 7/xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Xk9cFRpOTKdQ4r05AmvpDzupWVCBVrwyHU+qRyrhzJc=; b=nrrWVe7/nJNL/4lkU5dXQdAC9TEhmJkH6mnt6wcuckOSQAyUqPAN35t/dC4Th9+U++ 6MmB6Fmc6lM08M+wcDRtqI2IKb+dDseGHmZPxzpfad4b79g0wVXpOhioeaUBvGWDEy0O FlKKDC70MQ1Td7bGtOAgTaxCtIIbjqfXuDH3E3cnqcXGojSMcACjVWkmKXZwgbI+S/vW gCFZnjP4llxtO/pygJGbv8wt2DYQHWLgWVTylJqZd18aNQc7VyRWVzBUzi2/rQ46Zf0b n94N7MvIhXi6Fbz+FrzEYeDe8fzjqfzZZRC4Ah2jtflRlCjQhTIKYuPRvuTODK/oJfsV OoUA== X-Gm-Message-State: AOUpUlFwJUWK96jZaN046QvdhKpZHoCJbMSEEWqCNvWpA7Hs2VzVvaaK 7GQnrvtbrBLDvc8658dH9XdSSW3FiWniqyCiC2m+rw== X-Google-Smtp-Source: AA+uWPxSAZsywPdOElY5Ye5R7/ZHykVI4feNKRcNmrHlCOBonuKupocf5Q7cNWnxYDSzFra8PrUr+53hiFwpr2WUnKo= X-Received: by 2002:a19:1749:: with SMTP id n70-v6mr16831342lfi.54.1534355697113; Wed, 15 Aug 2018 10:54:57 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180815155700.GD30438@ofb.net> References: <20180815054958.GA27844@ofb.net> <20180815083359eucas1p157426370c46cd6d59b96b8964f0445ce~LAcQObm1u2570325703eucas1p1b@eucas1p1.samsung.com> <20180815155700.GD30438@ofb.net> From: Bart Schaefer Date: Wed, 15 Aug 2018 10:54:56 -0700 Message-ID: Subject: Re: completion autolist has time-sensitive interface To: Frederick Eaton Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" On Tue, Aug 14, 2018 at 10:49 PM, wrote: > Dear Zsh Hackers, > > Sometimes completion is so laggy on my system that when I press TAB > after e.g. "man perl", nothing seems to happen. So I press it again. > Still nothing happens. Completion seems broken. > > What happens is that if I just press TAB once, e.g. after "man perl", > there is a one-second delay and a prompt "zsh: do you wish to see all > 201 possibilities (51 lines)?". At this point I can press TAB again, > which is equivalent to "y" I guess, and I see a list of completions. The delay is almost certainly the time required to generate the 201 possibilities rather than any "intentional" pause that zsh is doing. Yes, at that particular prompt TAB and y/Y are equivalent, also ctrl-C and ctrl-D (eof) and n/N are equivalent. But there's more going on than that. Before displaying the prompt, zsh checks to see whether you have already typed something else (typeahead) and if you have, it assumes you decided to disambiguate the input further, so it skips printing the prompt and proceeds as if you had answered "n". So by pressing the second TAB while zsh is still working on the set of completion for the menu, you have told the shell you don't want to wait for the menu and it should simply proceed. > However, if I press TAB twice quickly in succession then I see no > list, it is exactly as if there are no completions at all. (Actually > if the prompt is at the bottom of the screen, I get a newline) The faster you press the two TABs, the more likely you are to trigger the typeahead detection. > I find > it confusing that the completion interface would be time-sensitive in > this manner. Why TAB-delay-TAB would behave differently from TAB-TAB. Back in the day, a lot of people would automatically muscle-memory whack the tab key after typing part of a word, realize they didn't mean to, and keep typing more of the word. They were annoyed when the shell ate part of their continued typing as the answer to the prompt, leaving them with a word with one missing letter in the middle, so the shell was changed to not do that. This is also why pressing a second TAB when the prompt does appear is treated as yes.