Page 1 of 1

Control-C, Control-Z don't terminate program in Jessie

Posted: Thu Jun 01, 2017 4:31 am
by zoom
I must have my keyboard set up wrong. I don't get the usual termination actions from within Terminal (or even from the CLI which the pi now boots to) when I hit Control-C or Control-Z. I've tried resetting the keyboard from within the gui (Pi > Preferences > Mouse and Keyboard settings > Keyboard > Keyboard Layout. When I choose "English (US)" and OK all the way out, this choice does not persist and when I replay the procedure to choose the keyboard layout, it comes up set to United States with a "Spanish (Latin American) setting highlighted. Since the gui (which I've started from both a user and a root session, no difference) method appears to be ineffective, what would be the CLI method for getting the right keyboard layout and the normal Control-C, Control-Z actions? TIA

Re: Control-C, Control-Z don't terminate program in Jessie

Posted: Thu Jun 01, 2017 10:28 am
by topguy
In my 13 years of Linux usage I've never experienced that keyboard layout has any effect on CTRL-Z or CTRL-C.

But not all programs behave the same way, software can handle the signal they get from CTRL-C and choose to ignore it.
In those cases CTRL-Z usually works for me because that is picked up by the shell ( I believe ) and the program is put in the background. ( and then I can kill the process manually )

It could be relevant to hear which programs you try to break the execution of.

Re: Control-C, Control-Z don't terminate program in Jessie

Posted: Thu Jun 01, 2017 11:21 am
by zoom
Initially just lua and python scripts. I don't think it's a characteristic of the programs involved - other distros almost always deliver the SIGINT that breaks one out of a program, with Control-C. It may not be keyboard layout but, I'm used to this being default behavior.

Re: Control-C, Control-Z don't terminate program in Jessie

Posted: Thu Jun 01, 2017 11:52 am
by topguy
Python is definitly one of the programs that have a special handler for SIGINT. Just start "python" in interactive mode and press CTRL-C to test.
CTRL-C is just another Exception i Python that can be easily caught ( intentionally or not ) by the script.

If you can run the "sleep 60" command in a shell and break it with CTRL-C (or suspend it with CTRL-Z ) then your keyboard works as intended.

Re: Control-C, Control-Z don't terminate program in Jessie

Posted: Thu Jun 01, 2017 11:55 am
by zoom
Problem solved - apparently this Dell keyboard is non-standard or malfunctioning. I simply hooked up another keyboard and experienced normal behavior with Control-C and Control-Z.

Re: Control-C, Control-Z don't terminate program in Jessie

Posted: Thu Jun 01, 2017 12:16 pm
by klricks
zoom wrote:........... When I choose "English (US)" and OK all the way out, this choice does not persist and when I replay the procedure to choose the keyboard layout, it comes up set to United States with a "Spanish (Latin American) setting highlighted.........
Even though the Spanish keyboard gets highlighted when you return to the setup, it is not actually changed to that unless you then press OK.

Also on some keyboards using the left or right CTRL key does not do the same thing.