Operating System - HP-UX
1834346 Members
2097 Online
110066 Solutions
New Discussion

Re: Control C not working

 
Cenoce_2
Advisor

Control C not working

On one of my system Cntrl C is not working.

output of stty -a

speed 9600 baud; line = 0;
rows = 42; columns = 125
min = 1; time = 1;
intr = ^C; quit = ^\; erase = ^H; kill = ^U
eof = ^D; eol = ^@; eol2 ; swtch
stop = ^S; start = ^Q; susp = ^Z; dsusp
werase ; lnext
parenb -parodd cs7 -cstopb hupcl -cread -clocal -loblk -crts
-ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon -ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop

echo $TERM
xterm


8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: Control C not working

Shalom,

Does it work on a remote login with vt100 TERM?

If not, I suspect its been overrriden with your system configuration.

Perhaps the termcap file does not support it or if it does work from other logins, perhaps a physical issue with the keyboard.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: Control C not working

This is one of those times when it may be working exactly as intended. Although when you ran stty from the shell, intr is indeed Control-C. All that means is that when Ctrl-C is detected a SIGINT is sent to the attached process(es) -- just as though you send a kill -2 PID to a process. However, that does not mean that the process will do anything if it receives a SIGINT; that is determined by the signal handler currently in place for SIGINT for that process. The response could be almost anything imaginable --- including completely ignoring the signal. The process could also be waiting on a higher priority event such as i/o so that it cannot respond to the SIGINT until the higher priority event is finished.

You can al least find out what you shell is set to do by simply doing a "trap" but this tells you very little about what any processes lauched from this shell will do.
If it ain't broke, I can fix that.
Cenoce_2
Advisor

Re: Control C not working

Thanks for reply.

I am using a remote session only.

On other machine if i type command on the prompt and before pressing enter if i press ctrl-c it terminates and prompt use to come.

But on this machine if I press ctrl-c nothing happens.it stays in same line.
A. Clay Stephenson
Acclaimed Contributor

Re: Control C not working

I assume that you are using telnet, rlogin, ssh, or something simliar. It would help to know exactly what you are using but in any event you need to issue these two commands on both your local machine (if it's a UNIX box) and when logged in as a remote session:

stty -a
trap

That should be sufficient to identify what is going on. I am making the assumption that you are simply as the shell prompt when you speak of using the Ctrl-C key.
If it ain't broke, I can fix that.
Cenoce_2
Advisor

Re: Control C not working

Hi,

the output trap shows as given below.
# trap
trap -- 'echo '\''logout root'\' EXIT

I am using putty to connect all boxes. only in this box the ctrl c is not working i have checked ssty -a uotput on both machine there is no difference.

So not sure why its not working on this box.

Marvin Strong
Honored Contributor

Re: Control C not working

well you could simply try to reset it.

assuming you are set -o vi.

stty intr ^v^C

yes press ctl v

see if that fixes it for you.
Cenoce_2
Advisor

Re: Control C not working

Tried that also it doesnt works.

If i am typing crtl V nothing is happeing on screen it is same as when it was ctrl C
Jonathan Fife
Honored Contributor

Re: Control C not working

Some sort of weird shell? echo $SHELL

Can you connect to one of the machines where ^C works, then ssh from there to the one that isn't and see if ^C works? That would eliminate putty configuration as a factor.

Decay is inherent in all compounded things. Strive on with diligence