Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  07 May 2009, Konstantin Olchanski, Bug Report, odbedit bad ctrl-C 
    Reply  04 Jun 2009, Stefan Ritt, Bug Report, odbedit bad ctrl-C 
Message ID: 588     Entry time: 04 Jun 2009     In reply to: 575
Author: Stefan Ritt 
Topic: Bug Report 
Subject: odbedit bad ctrl-C 
> When using "/bin/bash" shell, if I exit odbedit (and other midas programs) using ctrl-C, the terminal 
> enters a funny state, "echo" is turned off (I cannot see what I type), "delete" key does not work (echoes 
> ^H instead).
> This problem does not happen if I exit using the "exit" command or if I use the "/bin/tcsh" shell.
> When this happens, the terminal can be restored to close to normal state using "stty sane", and "stty 
> erase ^H".
> The terminal is set into this funny state by system.c::getchar() and normal settings are never restored 
> unless the midas program calls getchar(1) at the end. If the program does not finish normally, original 
> terminal settings are never restored and the terminal is left in a funny state.
> It is not clear why the problem does not happen with /bin/tcsh - perhaps they restore sane terminal 
> settings automatically for us.
> K.O.

Who uses bash ??? And who keeps baning on Ctrl-C, when there is a nice "exit" command ;-)

Well, I implemented a simple CTRL-C handler in odbedit (Rev. 4503) which resets the terminal before exiting. 
Give it a try. Of course this cannot catch a hard kill (-9), but CTRL-C works now correctly under bash at 
ELOG V3.1.4-2e1708b5