Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15623 > unrolled thread
| Started by | Chet Ramey <chet.ramey@case.edu> |
|---|---|
| First post | 2019-11-21 11:02 -0500 |
| Last post | 2019-11-21 11:02 -0500 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Fwd: Don't set $?=130 when discarding the current command line (not run yet) with CTRL-C? Chet Ramey <chet.ramey@case.edu> - 2019-11-21 11:02 -0500
| From | Chet Ramey <chet.ramey@case.edu> |
|---|---|
| Date | 2019-11-21 11:02 -0500 |
| Subject | Re: Fwd: Don't set $?=130 when discarding the current command line (not run yet) with CTRL-C? |
| Message-ID | <mailman.2211.1574352170.13325.bug-bash@gnu.org> |
On 11/20/19 9:27 PM, Clark Wang wrote: > It's quite common for people to press CTRL-C to discard the current command > line. This is harmless actually for most times except when people include > $? in $PS1. I also show $? in red color when it's not 0 so it's more > noticeable. So is it OK to not change $? when people are pressing CTRL-C to > discard the input? This behavior dates from at least 2009 and was added at user request so they could tell exactly that: whether or not entering the last command had been interrupted by a signal. (Before that, dating back to bash-4.0, it set $? to 128 for exactly the same reason, but that's clearly wrong. Before that, it set $? to 1 for as far back as I have bash versions built, but that doesn't tell you anything about signal receipt.) Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
Back to top | Article view | gnu.bash.bug
csiph-web