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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7758 invoked from network); 5 Apr 2021 10:05:26 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 5 Apr 2021 10:05:26 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1617617126; b=Nd3p9CaAQUZo55bi+yoHA0iXpdcbXOdX38uldF7bpNCP2iiI8uD+1w8rQd+lcYJUgzWrGziQ0k GEQdRftVvHL+W31QLCWjw5zIQK+230K8PWbxIY3ELK13VLVfB/kJV4ti1Ci3sNGTTKPlsHkiw1 dNS1gIPrf97+K3pJ96vrN6iCQVqGyB2IzVdluQ7fVhUDZmBb6V7kdGupUfgePhe2QRUaolZGDI 1y3CmgkijZsWGpK6cuMsoNrsjzFDrZytjVyD2wLM1BgSLZEmR6a+xpSui0wYvkOWh4WDzou5rw QUelaNFFcwQNQoYj39Q+6KeLO/W3+SUJWNeWMQxf/7IydQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mailproxy03.manitu.net) smtp.remote-ip=217.11.48.67; dmarc=none header.from=rkta.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1617617126; bh=D2SuTMVsp6ySjCLAQP9LHZyS6zN3aeb5Idzet1aRNjg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:MIME-Version:Message-ID:Subject:To:From:Date: DKIM-Signature; b=iE1Kx40PC311mRK3po2fDUTVOQzAcDnHC+/wOXgbcDlWCh4S1AhDVGLEOQwjnB/yIcMvNlsoBd XDedOWvId68NyV9LY2EW/U7SRRNcNHMabEgB6U/mn1+axZdVu8AMtR2sSIWIPyo31eHR3ytTvM VPTRZBKfBlrVrRI50B9jD+JRYCn66WUrp96iVGtNNOf6fMOm2QEMp84Qy2yCHtvg0JDomvBQlo 1BPmtw6d366OQ9jzZtmsGneiF6pKoy4VeRUNxoL+vdbOpMGo43ri3l0p3xjI3nhaDDafAFg45x eHvAgSLYoxw9a79WHzSYn6WmqalG2kJi7PRevhQZk62vvg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:MIME-Version:Message-ID: Subject:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=KSfA/yN/grKa3k0mjNVwIh/2Lzyve2MVMhCWj959NsI=; b=JD4ZQN9Cm4h81oTz8yphkZwsdp 6TTx8DysF81YrF5gjN3vjmIoA9884oLveIwVU1q2QoC+2rScOlVXOabKGI/coWUMqFoJZVXD5uuVe bw/LEF0dYBFMeLTQ+7H5fgFCvvZDm1ZqFdz/76w4smfs4f108Txp2Ldeh0pOlMAg9B7c9eLGLJC/2 dB5tZaxyrXuXq/t3SVbafVrmyQq3rBxquA0SbliOU0JTxrzuEWVLmcIvoLzpoLfWRtkTwzd8gLh/U 9BmOVtXTmfwUmUu68b8dOT7JfKSlAS2qU3U9LmyoH57qzLUJXWHO8g93mvYbqjtpzCG5kndxhop2t GCILITbw==; Received: from authenticated user by zero.zsh.org with local id 1lTM6l-000EcK-Rt; Mon, 05 Apr 2021 10:05:23 +0000 Authentication-Results: zsh.org; iprev=pass (mailproxy03.manitu.net) smtp.remote-ip=217.11.48.67; dmarc=none header.from=rkta.de; arc=none Received: from mailproxy03.manitu.net ([217.11.48.67]:47318) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lTM6I-000EEe-Sj; Mon, 05 Apr 2021 10:04:55 +0000 Received: from localhost (p200300ef4f26d83526418cfffe37d02a.dip0.t-ipconnect.de [IPv6:2003:ef:4f26:d835:2641:8cff:fe37:d02a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: u16723@rkita.de) by mailproxy03.manitu.net (Postfix) with ESMTPSA id 38EABD4003D; Mon, 5 Apr 2021 12:04:52 +0200 (CEST) Date: Mon, 5 Apr 2021 12:04:52 +0200 From: Rene Kita To: zsh-users@zsh.org Subject: Previous job and Zsh function Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Seq: 26622 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: Archived-At: Basically I have 2 programs, one started directly, one started from within a function. I switch between these programs with 'CTRL-Z' and '%-'. When putting the program which is started from the function to the background, '%-' will put this program to the foreground again. I then have to choose the other job by number. Here is an example: % zsh -d -f % function func(){ man zsh; } % man sh # press CTRL-Z zsh: suspended man sh % func # press CTRL-Z zsh: suspended % jobs [1] - suspended man sh [2] + suspended % %- [1] - continued man sh # press CTRL-Z zsh: suspended man sh % jobs [1] + suspended man sh [2] - suspended # Previous job is function % %- [2] - continued # press CTRL-Z zsh: suspended zsh: suspended # Why a second time? % jobs [1] + suspended man sh [2] - suspended # Previous job is function % zsh --version % zsh 5.8 (x86_64-ubuntu-linux-gnu) % I'm not sure if this is a bug or if I lack understanding. Am I doing something wrong? Is this working as indented?