zsh-users
 help / color / mirror / code / Atom feed
From: Rene Kita <mail@rkta.de>
To: zsh-users@zsh.org
Subject: Previous job and Zsh function
Date: Mon, 5 Apr 2021 12:04:52 +0200	[thread overview]
Message-ID: <YGrgxIdDyGxKF2wi@t480> (raw)

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?


                 reply	other threads:[~2021-04-05 10:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=YGrgxIdDyGxKF2wi@t480 \
    --to=mail@rkta.de \
    --cc=zsh-users@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).