From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12974 invoked by alias); 25 Jul 2017 21:03:49 -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: X-Seq: 22785 Received: (qmail 26849 invoked from network); 25 Jul 2017 21:03:49 -0000 X-Qmail-Scanner-Diagnostics: from mail-qk0-f169.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.220.169):SA:0(0.5/5.0):. Processed in 1.003622 secs); 25 Jul 2017 21:03:49 -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=0.5 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM,SPF_PASS, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 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.220.169 as permitted sender) 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=ue2xttuFIQQFRgR3qxGEI+HOgnnKoFMIB9PeWh7D3yM=; b=yNFLxYW62KAvk2guniXi9pmmG05oyR3TeKsMNjkDYpAGAeI+tV8lvleVr49vkQ+Z2a J09zBA2gGkyMubQmHO1kktjvMVBIsp7fWc461A8OsOiZPnUhOIZaGvWiJYbnwU7jD5EP kblgDH8WW8VjMdviJOBrLNkXWT9STMrwUiSo02gIGv1mAkDWZuVwqCiMqG9MJgpg124Y eXmL/WKkaxvaLjrzqHozzExNVr9oyFVDu5djJ0XgaI9LeziIL+8yoqrg9LFSS4XfFQrl CnXhZsueYcbU/DDUdScc1A1djiFu7mGGCDTt49xhxExvUhzqZgKyGbh5r+9sFHRs/3wE KCZQ== 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=ue2xttuFIQQFRgR3qxGEI+HOgnnKoFMIB9PeWh7D3yM=; b=Bf8C5QEnIf6RdPaaUvkmhdn6UskhlYFKyDmlVkNCelOnP92G1PYvJbiTw+Eo84hx5O uF+0P3+j6fZbcdx3CfmSGwfYkIVAR216B6evzGNsfqcWuJ516BoYLApWegeCOC5CRGtA bmfJrZ1MtpKXvNx1Mk48/wNYeUAd2y6uuzqO3FYbAX0MRcLHQlO8p360FLr6h9HIE8eP +T6bTw2PDZ3GlanWBzpLo+5zqPTD02jLi8cB8w+ukjV3q8flpBkPoul2V/4wI+BhxM/g Ib1QSnXR/+ghJxdz5BBTnPVztvgWBk0pUPOB6nEjzpbwk/0eT0HXvqxqhbaAGKxeazXj cnsw== X-Gm-Message-State: AIVw113FzNILeV+SQl5mtlsarr/f1ORuq7bZ4kfHYFGugdVymRMYo2y9 6AmyVrK1dn3UVUB0N4FSbkhHDgM5Iyi4ipc= X-Received: by 10.55.130.66 with SMTP id e63mr27382435qkd.253.1501016620654; Tue, 25 Jul 2017 14:03:40 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Bart Schaefer Date: Tue, 25 Jul 2017 14:03:39 -0700 Message-ID: Subject: Re: Redirecting a programs job control messages to parent's STDOUT To: Zsh Users Cc: zv Content-Type: text/plain; charset="UTF-8" Meant to reply to this before; it got lost in the aftermath of returning from a vacation. On Mon, Jul 10, 2017 at 2:16 PM, zv wrote: > I've defined a function in my .zshrc to compile & run a file What's going on here is that the function is considered to be running within the current shell, so job status messages for the exit status of the function are not printed. The exit status of the function is the status of the last command it executed, so if you were to examine the value of $? (or $status) after the function was done, you would see that it reflects the failure. The lack of message has nothing to do with how the executable or path to it was created. So you have a couple of choices: 1. Run the command in the background so full job control applies during the function, which is effectively what Vartan describes; or 2. Examine the exit status yourself and print your own message. E.g. if you end your crun function with $exepath "$@" integer stat=$status if (( stat > 128 )); then print -u2 -- ${exepath}: exited with SIG${signals[stat-127]}; fi return stat You'll see something like faulty.c: exited with SIGSEGV You could also/instead "setopt print_exit_value" which would give something like zsh: exit 139