From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10744 invoked from network); 30 Nov 2022 14:13:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Nov 2022 14:13:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1669817617; b=V9STwfCfRQMRD3SwQTG+X36aLWsNQefMfpZD5jjo5lBrbNMeMH4us1tsfJOu9SBsYlFtZ1WI1z EArBrDhFkBTyg+SFT0HQtQCh5N1uMlx99tKAl3SmN4HCAZbQVLW18L4zTqFVwV3SluFrXzOavb IZEI5xbifm4ucmbL9zZFP80rBdwXC6K2JpI7rdf5a6m2fy0F3E6gjn1900y47IkW/6CmvJcYWL BTEEiSxpH9Q4qL4OISH92ge1yCjkHjdAicmrNwsxfGYaMpsZsz80jfVUKa6X0AiFT6soqfUg4B i7k/0udUdxe37iEgjNETJ/DlaxS3kUx0QmO+zNu2uyVOxA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yw1-f171.google.com) smtp.remote-ip=209.85.128.171; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1669817617; bh=RXOPzBMaZyxw7d59UJwFSGkqkYnSQYc+5Rjo1TcXbUA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=ZAox9tEl3rQ+OkE/G5EEwLpJwm1wKDw9jAvW9agJrcD+nSbdBesUR8Hn2ANX52J8NfzrUGH7xH rB8YADxq8zS0vQdtGkFJlJ4Ss1NOtvzf1DwVFUY50ae823kq+uORGh9Ajp+aA+Ni/JgJbhhPV4 Rd7vdhsMRW/966u4038Pu5OWAN1W5bnwWSM8IZkxbsFVb4ds8Ki5GnyQWTS5sA8dF7a+rPSNvl Tu/dM+nSqySM87GHC1Q0J7CQL0zgpGz20wWCmT3HTQgzegGvwI841elFIN+ox5pxlSO6G8CXQr XCYPlztOkTt8GCG7Udw6Ytd5GvM3Q0Iwg2Wsli71gVZ68w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ftg1GbVKkyhtkbjvi6AefEiT/7tBphUR7s4Hw1pr6pQ=; b=Hfrdzu/4TpOqZ1KEx1Milth8cg r1XfA0N2kQxwtgALN+u0X6GP2BaKQFauf8jwRMAmLjIeh3Bby2UfDHR31xeE1Au5XsmM94Zzmf5wb tIGpY4GeI+KhyPstfqucWFd59Fi3ERI3vlzjJII8nXuwfC4xiTophDEquIW3gpRFZRP1uUj13vNFY 46Agx93E85PBJgHIBBjiaL3kpjey3R9h1O7wnFwWXnS2FWAdBNLc6Sh+97BqLVBBp2mN5tmr1EDK1 odOio3Mbf2gC/FXjvihC7hwts7p0kvG3Eun/AiDraUoktLnwsApH+OD0rnJbmRARHub1v4M4GZffL tqYouHPg==; Received: by zero.zsh.org with local id 1p0NqD-000Pqk-3a; Wed, 30 Nov 2022 14:13:37 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yw1-f171.google.com) smtp.remote-ip=209.85.128.171; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-yw1-f171.google.com ([209.85.128.171]:40853) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1p0NnF-000O0n-KD; Wed, 30 Nov 2022 14:10:34 +0000 Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-381662c78a9so171998087b3.7 for ; Wed, 30 Nov 2022 06:10:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ftg1GbVKkyhtkbjvi6AefEiT/7tBphUR7s4Hw1pr6pQ=; b=JN7UH45zqeaJ7hvaNT6BdcnJIhgUtWxXcRG24SXedCl3iQaXTwL17VlAl8cFdompSU ohzOWQA1zIOr4bIj4X2+ZYkE0wWaw4E6+NHWLAC5w7sA4Np09/pnPemjF0p/DmPvWAMJ V6IpCc55YXyxAMnbryExX47TdQZg7onOGv6fB34SQ1/aG3fYFoa/k8h/OlxNiyib4Gd7 Ty8huVVeMlyWlljXMw3+80xq5wI39ibzTDtuw8UGrwEB8aboTnZg5lYAhMKmE5orsilu g8++pTXSv9j50qtOumxFKmI2f/j+4q+laYUKO2VWliIE6vOP4FqF8zOwCW8qpVAD1yzN ZSvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ftg1GbVKkyhtkbjvi6AefEiT/7tBphUR7s4Hw1pr6pQ=; b=E/uUpg3peRzjH5w7WraCBbnwgCVFqTqJRIxs4sYKRdEhK2KyIE3t9CFdXcMeUvNMc8 4Aq4quzImjNWuMxv/+JTHJheXJswfyWTocM6hqkFQPucmZAx/xu17Ot778FbjtfdMzIH O4FimrPDOdVNrJb+tFkVk00ztw2EIyBBRP7uL8lbKisTo8B1A1wWS3s1QgEHWgsFH5dN Q+OwWnrZDoaq/Zfd1RFs6BiCJ+HqfKn9M3a5rb4a83J2D9CXjAY9leaDWL2D/JSaB7xG fXEm401wlkXTLzbOR/szrlipCgvC9eci34T2OQ50ZpRd9ygI8T3qtNMoRKfwcGvjtNik IvOw== X-Gm-Message-State: ANoB5pmDSv1IYZEW6wFaFgI+wrfyrjHwSYXW7pE7SbsnplgiqGb9iLHd Dudxjp9BwU8rDFz5v0lcW5hqCt8d1pvZLP30mek= X-Google-Smtp-Source: AA0mqf7z0UJtBGyS8BMvoBLOzJJT6vUEptIdYBQJpChbsMePUiavRNfDSOTOdhM0qpLuuPFnohC/jr52G9Nbx/UwUNk= X-Received: by 2002:a81:160e:0:b0:3bf:c5fb:2550 with SMTP id 14-20020a81160e000000b003bfc5fb2550mr19336269yww.286.1669817432242; Wed, 30 Nov 2022 06:10:32 -0800 (PST) MIME-Version: 1.0 References: <5d0c4e22-80b0-2fd2-ee75-6902da52d121@eastlink.ca> <57e8e248-bb1a-663a-8557-e3fc13f671d4@eastlink.ca> In-Reply-To: <57e8e248-bb1a-663a-8557-e3fc13f671d4@eastlink.ca> From: Roman Perepelitsa Date: Wed, 30 Nov 2022 15:10:21 +0100 Message-ID: Subject: Re: one time in 20 error To: Ray Andrews Cc: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 28452 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Wed, Nov 30, 2022 at 2:57 PM Ray Andrews wrote: > > I can press and hold the button, wait for the program to end (so far mouse > clicks always make a selection from a list and return) and then release the > button and, again, maybe one time in 20 I'll get the bogey. I've tried > variation on click speed but nothing makes it better or worse. You don't > suppose it could be a mechanical issue with the mouse? You know how they > sometimes get sticky and mouse clicks are poorly registered? I've had mice > that tended to return two clicks when only one was made. A mechanically > unclean release seems to confuse the computer. What happens is that you click while the script is running and listening to mouse events, this causes the terminal to send you data, which can take arbitrary long to arrive to your script's stdin. Then the script deactivates mouse tracking and exists, and then the data from the past click reaches stdin. Clicks after the script exits won't generate any data because mouse tracking is already disabled. > Well, so far the 'timeout' is working 100% It won't work if you run your script over SSH with high latency. Moreover, it adds lag every time the script exists. A better solution is what I posted above. It doesn't add more latency than necessary and will correctly clear stdin with any amount of latency between your script and the terminal. The code I posted needs to be run when the script ends. If your script disables mouse tracking on its own, you can remove the first two `print` statements from my code snippet. Roman.