Ctrl-C doesn't work in the shell
Hi, When I'm on a sheel on LCD using USB keyboard, all works fine (except another important problem..) but Ctrl-C key doesn't work. When I press ctrl-C, '^C' is displayed on the screen (prompt line), but doesn't have the effect of killing the job. For example, I start ping and it displays the response every second, but even if I press Ctrl-C, it contiues pinging. What should I do? Thanks! Chan
Hi Chan The situation is probably because a programmer implemented catching ctrl-c signal in a different way or maybe your process is waiting for some data. If it doesn't respone you can find the process id using 'top' or 'ps aux' command and send to it 'kill -9' signal. This is very brutal way of closing process, but sometimes it's the only option. Cheers, crooveck 2014-04-01 7:57 GMT+02:00 Chan Kim <ckim@etri.re.kr>:
Hi, When I'm on a sheel on LCD using USB keyboard, all works fine (except another important problem..) but Ctrl-C key doesn't work. When I press ctrl-C, '^C' is displayed on the screen (prompt line), but doesn't have the effect of killing the job. For example, I start ping and it displays the response every second, but even if I press Ctrl-C, it contiues pinging. What should I do? Thanks! Chan
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On Tue, 01 Apr 2014 05:57:05 -0000, Chan Kim said:
When I'm on a sheel on LCD using USB keyboard, all works fine (except another important problem..) but Ctrl-C key doesn't work. When I press ctrl-C, '^C' is displayed on the screen (prompt line), but doesn't have the effect of killing the job. For example, I start ping and it displays the response every second, but even if I press Ctrl-C, it contiues pinging. What should I do?
This often happens if you've managed to launch a shell that doesn't set itself up as "interactive" and/or acquire a control terminal. Quick test - if you do a 'ps', does the shell process show up with a ? or with a tty<something>? If it shows ?, it hasn't gotten a control terminal. Your shell may have a '-i' flag to make it interactive and/or a '-l' to make it be a login shell, those flags may be an easy way to fix the problem.
Hi, Valids and others I saw the email replies only yesterday afternoon. Reading those and other internet posts, reallized my shell on the LCD is working as a console. (When I type tty, it responds with 'console'). So I set the boot argument 'console' back to ttyS (serial port) and removed the etc/inittab so that default inittab will take effect. Default inittab starts shell on tty2, tty3 and tty4. And I ran it and vola! the console is in the UART terminal and I could switch to different shell windows by pressing Alt-F2, Alt-F3 and Alt-F4. I now have console on the UART terminal and 3 shells on the LCD which I can switch between. Thanks all for good suggestions (not only this Ctrl-C but others like printf system call source location..). Best regards, Chan ________________________________ From : "Valdis.Kletnieks@vt.edu" <Valdis.Kletnieks@vt.edu> Sent : 2014-04-01 23:13:49 ( +09:00 ) To : Chan Kim <ckim@etri.re.kr> Cc : kernelnewbies@kernelnewbies.org <kernelnewbies@kernelnewbies.org> Subject : Re: Ctrl-C doesn't work in the shell On Tue, 01 Apr 2014 05:57:05 -0000, Chan Kim said:
When I'm on a sheel on LCD using USB keyboard, all works fine (except another important problem..) but Ctrl-C key doesn't work. When I press ctrl-C, '^C' is displayed on the screen (prompt line), but doesn't have the effect of killing the job. For example, I start ping and it displays the response every second, but even if I press Ctrl-C, it contiues pinging. What should I do?
This often happens if you've managed to launch a shell that doesn't set itself up as "interactive" and/or acquire a control terminal. Quick test - if you do a 'ps', does the shell process show up with a ? or with a tty? If it shows ?, it hasn't gotten a control terminal. Your shell may have a '-i' flag to make it interactive and/or a '-l' to make it be a login shell, those flags may be an easy way to fix the problem.
Ah, of coursee Ctrl-C works on the console and LCD shells. I set the Job-Constrol option in the busybox shell options. ________________________________ From : "Chan Kim" <ckim@etri.re.kr> Sent : 2014-04-09 10:03:10 ( +09:00 ) To : Valdis.Kletnieks@vt.edu <Valdis.Kletnieks@vt.edu> Cc : kernelnewbies@kernelnewbies.org <kernelnewbies@kernelnewbies.org> Subject : RE: Ctrl-C doesn't work in the shell Hi, Valids and others I saw the email replies only yesterday afternoon. Reading those and other internet posts, reallized my shell on the LCD is working as a console. (When I type tty, it responds with 'console'). So I set the boot argument 'console' back to ttyS (serial port) and removed the etc/inittab so that default inittab will take effect. Default inittab starts shell on tty2, tty3 and tty4. And I ran it and vola! the console is in the UART terminal and I could switch to different shell windows by pressing Alt-F2, Alt-F3 and Alt-F4. I now have console on the UART terminal and 3 shells on the LCD which I can switch between. Thanks all for good suggestions (not only this Ctrl-C but others like printf system call source location..). Best regards, Chan ________________________________ From : "Valdis.Kletnieks@vt.edu" <Valdis.Kletnieks@vt.edu> Sent : 2014-04-01 23:13:49 ( +09:00 ) To : Chan Kim <ckim@etri.re.kr> Cc : kernelnewbies@kernelnewbies.org <kernelnewbies@kernelnewbies.org> Subject : Re: Ctrl-C doesn't work in the shell On Tue, 01 Apr 2014 05:57:05 -0000, Chan Kim said:
When I'm on a sheel on LCD using USB keyboard, all works fine (except another important problem..) but Ctrl-C key doesn't work. When I press ctrl-C, '^C' is displayed on the screen (prompt line), but doesn't have the effect of killing the job. For example, I start ping and it displays the response every second, but even if I press Ctrl-C, it contiues pinging. What should I do?
This often happens if you've managed to launch a shell that doesn't set itself up as "interactive" and/or acquire a control terminal. Quick test - if you do a 'ps', does the shell process show up with a ? or with a tty? If it shows ?, it hasn't gotten a control terminal. Your shell may have a '-i' flag to make it interactive and/or a '-l' to make it be a login shell, those flags may be an easy way to fix the problem.
From: kernelnewbies-bounces+jharan=bytemobile.com@kernelnewbies.org [mailto:kernelnewbies-bounces+jharan=bytemobile.com@kernelnewbies.org] On Behalf Of Chan Kim Sent: Monday, March 31, 2014 10:57 PM To: kernelnewbies@kernelnewbies.org Subject: Ctrl-C doesn't work in the shell Hi, When I'm on a sheel on LCD using USB keyboard, all works fine (except another important problem..) but Ctrl-C key doesn't work. When I press ctrl-C, '^C' is displayed on the screen (prompt line), but doesn't have the effect of killing the job. For example, I start ping and it displays the response every second, but even if I press Ctrl-C, it contiues pinging. What should I do? Thanks! Chan It’s been a few years since I last ran into this, but I used to see the same behavior when the shell was provided by BusyBox. At the time, the BusyBox shell didn’t provide any sort of job control, which meant hitting ctrl-C to kill processes was expected to not work. That might be your issue too. Ping’s -c option to limit the number of packets transmitted was my friend back then. Jeff Haran
participants (4)
-
Chan Kim -
Jeff Haran -
Paweł Tomaszewski -
Valdis.Kletnieks@vt.edu