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

Re: [PATCH] Fix %- (prevjob) picking wrong job after resuming





On Sun, 5 Apr 2026, 17:45 Bart Schaefer, <schaefer@xxxxxxxxxxxxxxxx> wrote:
On Wed, Apr 1, 2026 at 11:31 PM Mikel Ward <mikel@xxxxxxxxxxxxx> wrote:
>
> Hmm. I didn't touch the message, so I'm not sure what's going on. It looks like that code path has always printed "no current job" and "no previous job"?

Yes, that code path has always printed that, but prior to your
previous patch that code path was not taken in the circumstances of
that test, and instead the code at Src/jobs.c lines 2118-2119 was
invoked.  Is that now dead code, or conversely are there other
side-effects to look out for?


I'm not finding those lines on my phone, but if you mean the existing ones that print messages with the "%%%s: no such job" format, those are still needed when using a numeric job spec like %1 rather than %-.

As for side effects, I'm honestly not sure. I think it makes things more consistent, and moves us in the right direction. Do any edge cases come to mind? Any tests you think we should add? Should we uncomment the other tests in W02jobs.ztst around lines 86-108? I couldn't repro the race when I tried.




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