> I have put "($?)" in my PS1 string in order to display the exit status
> of the last command in the /bin/sh prompt. However, this only seems to
> work for certain programs. e.g. The prompt shows the exit status after
> running gcc, ld, the other GNU utilities included with MinGW and MSYS,
> as well as upx. For most other programs though, including my own (which
> I have built using MinGW), the exit status is always zero and does not
> reflect the actual exit status.
> How can I fix this? What is special about e.g. upx that the shell prompt
> reports its exit status, but does not report the exit status of most
> other non-MSYS apps?
> edit: I just found the problem: the prompt only reports the exit status
> if the status is >= 0. If the exit status is <0, the prompt will always
> report zero. Is there any fix, besides modifying the sources of sh?
Can you please submit this as a bug. Explain it the way you have here.
MinGW - http://www.mingw.org/
Wiki - http://www.mingw.org/MinGWiki/
SF Project - http://sourceforge.net/projects/mingw
Job Listing - http://sf.net/people/viewjob.php?group_id=2435&job_id=21643