Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Automate keypresses
- X-seq: zsh-users 23890
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Christian K <syphdias@xxxxxxxxx>
- Subject: Re: Automate keypresses
- Date: Sat, 30 Mar 2019 13:15:10 -0700
- Cc: Zsh Users <zsh-users@xxxxxxx>
- 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==
- In-reply-to: <CAJiY44qCAM8Q9vk_8o9kin-LX1ofLcvaiboG1dzq3tb-3HRHRw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAJiY44qCAM8Q9vk_8o9kin-LX1ofLcvaiboG1dzq3tb-3HRHRw@mail.gmail.com>
On Sat, Mar 30, 2019 at 9:49 AM Christian K <syphdias@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author