top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to catch the ESC or ctl C key when using readline?

+1 vote

I would like to catch the ESC or ctl C key when using readline. It should jsut line the editing with a character that I can identify.

posted Sep 29, 2013 by Meenal Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes

CTRL + C will send signal SIGINT. You can catch this signal and write your own handler and then SIGINT won't kill presently running program but do whatever you have written in your signal handler.
I am not sure if this will meet your exact requirements or not.

answer Sep 29, 2013 by anonymous
Similar Questions
+1 vote

In large product based companies LLD is written by senior team members and developers write the code.
Does the senior team member decide what data type they should use in advance ? If yes then what things derives type of data for example. How they decide a variable should be declared as volatile ? and what would be advantage of having a variable volatile and what could be the problem if it is taken without the volatile ?

+1 vote

double the number of vowels in a given string using c programming language
Given String="Maven"
Output Required="Maaveen".

0 votes

Does someone have a ready-made code then please share? it would be very helpful?