zsh-workers
 help / color / mirror / code / Atom feed
From: Aryn Starr <whereislelouch@icloud.com>
To: zsh-workers@zsh.org
Subject: [RESEND] Is there a way to put a timeout on a function?
Date: Fri, 4 Sep 2020 13:45:27 +0430	[thread overview]
Message-ID: <CD3381EE-6AE8-4E0C-A432-4E358E61ECF4@icloud.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 922 bytes --]

Prescript: I sent this email 4 days ago, but somehow it is not appearing in the archives https://www.zsh.org/mla/workers/2020/index.html <https://www.zsh.org/mla/workers/2020/index.html> . This has happened with my other recent messages to the mailing list, and I am confused as to what is happening. Is this email being received but not put in the archives?

---

I need to limit the execution time of arbitrary zsh functions. Is there a way to achieve this? I'm ok with just adding a time limit to all the external commands, but I do not know how to do that. (I don't want to manually prefix all my commands with the GNU timeout command.)

On a sidenote, I would also like to make the shell stop forcefully (like when a glob fails) if it doesn't find an external command. I thought maybe these two problems might have similar solutions. Is prexec viable for them? Does preexec even work for noninteractive scripts?

[-- Attachment #2: Type: text/html, Size: 2718 bytes --]

             reply	other threads:[~2020-09-04  9:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04  9:15 Aryn Starr [this message]
2020-09-04 18:45 ` Daniel Shahaf
2020-09-04 19:51   ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CD3381EE-6AE8-4E0C-A432-4E358E61ECF4@icloud.com \
    --to=whereislelouch@icloud.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).