hanslub42 / rlwrap

A readline wrapper
GNU General Public License v2.0
2.59k stars 151 forks source link

Assign behaviour to SIGINT #106

Closed vinipsmaker closed 3 years ago

vinipsmaker commented 4 years ago

Hi, I've tried to customize the hotkey for C-c by putting this in the .inputrc file:

$if luajit
    "\C-c": kill-whole-line
$endif

But rlwrap keeps sending C-c to the luajit program which is awful given default luajit behaviour is to just quit the session (and lose all the environment I was working on).

hanslub42 commented 3 years ago

By default, C-c is caught by the terminal (which then sends a SIGINT to the foreground process group) and is never read byrlwrap(let alonereadline`)

However, calling stty intr undef before rlwrap luajit will make the terminal pass C-c to rlwrap where it then can be interpreted any way you see fit.