Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16175 > unrolled thread

Re: looking for consistent C-c trap behavior

Started byChet Ramey <chet.ramey@case.edu>
First post2020-04-19 15:20 -0400
Last post2020-04-19 15:20 -0400
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.


Contents

  Re: looking for consistent C-c trap behavior Chet Ramey <chet.ramey@case.edu> - 2020-04-19 15:20 -0400

#16175 — Re: looking for consistent C-c trap behavior

FromChet Ramey <chet.ramey@case.edu>
Date2020-04-19 15:20 -0400
SubjectRe: looking for consistent C-c trap behavior
Message-ID<mailman.712.1587324065.3066.bug-bash@gnu.org>
On 4/18/20 6:45 PM, gentoo_eshoes@tutanota.com wrote:
> 
> 
> 
> Apr 18, 2020, 23:41 by gentoo_eshoes@tutanota.com:
> 
>>
>> On another note, I naively tried to patch out the POSIX requirement, for my own/local_use puposes but had no effect:
>> in this code
>> +  /* posix mode SIGINT during read -e. We only get here if SIGINT is trapped. */
>> +  if (posixly_correct && this_shell_builtin == read_builtin && sig == 2)
>> +    {
>> +      last_command_exit_value = 128|SIGINT;
>> +      throw_to_top_level ();
>> +    }
>> by removing "posixly_correct &&" from above. I've no idea why that would have no effect, a bit stumped.
>> I've even tried with a prior 'make clean'. The only explanation is that some other code that happens only during `POSIXly correct` mode is affecting this somehow...
>>
> regarding the above, I stand corrected: it does indeed have effect but only on 'read -e' (just as the comment states), that bash_event_hook() function isn't entered for 'read -p' which to me was surprising, yet no doubt correct(I'm guessing).

The hook functions are a way for readline to communicate with calling
applications when signals or other events happen, since you can't really
do very much in a signal handler, so they're not called when not using
readline.

> The code that allows 'read -p' to be interrupted when posixly_correct, must then be somewhere else, I shall keep lookin', yet I fear I might not find it :-"

Look in read_builtin() and the calls to various zread* functions there.


-- 
``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/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web