From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 82365224 for ; Sat, 30 Mar 2019 20:16:11 +0000 (UTC) Received: (qmail 14310 invoked by alias); 30 Mar 2019 20:15:58 -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: 23890 Received: (qmail 14274 invoked by uid 1010); 30 Mar 2019 20:15:58 -0000 X-Qmail-Scanner-Diagnostics: from mail-lj1-f170.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.1/25398. spamassassin: 3.4.2. Clear:RC:0(209.85.208.170):SA:0(-1.9/5.0):. Processed in 2.06638 secs); 30 Mar 2019 20:15:58 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.208.170 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5aRK+h4TUn4Lu5XytktG3fWB2Tnb5p0M5DMyZuxxBk0=; b=l19986w/GCESsm1fDewK3WKLBT3wL8VF8PnbnJMDp1RR4+tCrBv4wcyYYInorlzKm8 +sMQoL00iz8l5Gj4xYrtj8g8J/S7yII/YqPFWcbv9sXGtGGYOaoMSne4vuCaIUFJ05+6 8H+PFHoAUWtZ/63rT6+MNaoGCYHszz6KS2FBKrCUADslzubBN1SEsNVzLzaLTKH5TlWL ySnJ+KcWtQ3htKsR0wRneGJ6nW71jrOH/Ky8AGOAOGLzLaH5+QGvdFiv20oLcz/oQ9KI Lv40neo1w/grLDsmFx6iOrDJhmKPqgIxgh5/wc/1e/CqTxeQR4W0upGp/2Ds2h+2TCkY 2g3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5aRK+h4TUn4Lu5XytktG3fWB2Tnb5p0M5DMyZuxxBk0=; b=aL2ulxO5N+HNh/fprq5AVqAPWoC0tFRKRnZ/NT3O26HJisXkp+5TnOvZOKAI6qwPu8 4b4BgtOQs3zR86Yx95x4Y1D+W4LZ84Q6w38u67Ld+VhpSc09AJh5Yq9MIU2HRL8iz/mg tk6xVAWwmpwsqmavbMOqWjC8ObMpICK6Nc3z4GQltRRAdsT7WpAB2VU4T0S5vgkOAzxl c69X1yEupIlBaMRhMmpMgG0IDJguZE73bKdRffVWjTtItcasqMCAz8Ikm6QzBZZV7hg+ zjk1p1u9FwJVcAJJKcCBGc5zQf/0uU8sP4vw7pgtPSDFlj4QL2SyczoxXOGi573P6umk wEUQ== X-Gm-Message-State: APjAAAX2FSMdMpc873g3vWjzbQqsCIVFTnxjyPcjTef4AJ55dVOFkLNJ Ayo3+yqyyW/4rzdHL1+CZTwrEL5Z0HkFuaolDFlUzw== X-Google-Smtp-Source: APXvYqyXjVZqyocNX539yMdE9kMevj0OCupvRKwEKCV/i1HaqiBmcvY12tX8TI7POoEn5abJC6WrctSW6Dcu6tU4LFE= X-Received: by 2002:a2e:4a1a:: with SMTP id x26mr26743848lja.49.1553976922201; Sat, 30 Mar 2019 13:15:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sat, 30 Mar 2019 13:15:10 -0700 Message-ID: Subject: Re: Automate keypresses To: Christian K Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" On Sat, Mar 30, 2019 at 9:49 AM Christian K wrote: > > I'm trying to automate a benchmark for prompt render times with > https://github.com/romkatv/zsh-prompt-benchmark. This requires a pressed > Enter key to work. > > Is there a way so simulate key presses without using something like expect? Since this is expected to run in an interactive shell, you probably want something like this: benchmark-prompt() { # adjust number of repeats as necessary repeat 100 zle -U $'\n' zle -U $'zsh-prompt-benchmark 5 0\n' } zle -N benchmark-prompt Then invoke with M-x benchmark-prompt RET