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

Re: jobs not listing all commands



On Feb 18,  8:25am, James Devenish wrote:
} Subject: Re: jobs not listing all commands
}
} > Prompts don't update between two interactive commands, ever, no matter
} > what the reason.  The prompt string is computed when ZLE initializes
} > (just before it is first printed) and is thereafter used verbatim until
} > the next re-initialize.
} 
} I'm a bit confused by both of the both comments.

What I mean by "between two interactive commands" is "after one command
finishes (and the prompt is printed) but before the next one _begins_
(i.e. when accept-line is executed)."

The empty command is still a command for this purpose.

} Firstly, %j works "as a user would expect" for me in zsh v4.1.1 (i.e.
} I get the behaviour that Felix expects).

I suspect you really don't.  Try this:

zsh -f
% PS1='njobs:%j %'
njobs:0 % sleep 60 &
njobs:1 % sleep 10 &
njobs:2 % 

Now wait 10 seconds.  You should see:

[2]  + done       sleep 10
njobs:2 %

Note that the prompt has not changed.  If you now hit return, it should
change to:

njobs:1 %

} Secondly, %t, %@, %T, %*, %? (etc.) work as expected in PS1

I think you'll find they work the same as %j in the example above.



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