Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Previous job and Zsh function



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?




Messages sorted by: Reverse Date, Date, Thread, Author