Bug 153275 - [dstore-shells] Ctrl+C does not break remote program
Summary: [dstore-shells] Ctrl+C does not break remote program
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.1 M6   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-09 07:51 EDT by Martin Oberhuber CLA
Modified: 2009-03-19 17:50 EDT (History)
0 users

See Also:


Attachments
patch to end shell process on ctrl+C (1.57 KB, patch)
2009-03-18 16:05 EDT, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2006-08-09 07:51:58 EDT
Open a Linux-dstore connection, and a shell within the connection.
Launch a remote program from the shell.
Press Ctrl+C --> The remote program is not stopped.

On ssh shells, this works properly.
Comment 1 David McKnight CLA 2007-05-30 12:15:54 EDT
For the IBM stuff, we have a psuedo terminal (written in C) that can deal with sending signals.  RSE's command miner detects whether this is available to determine whether to use it for it's wrapper shell or just use the shell.  With just io streams, dstore is unable to send signals appropriate for Ctrl+C.  The only work around is to use the psuedo term but that's not available in open source.  Do to this limitation I'm not sure how to address this bug.
Comment 2 Martin Oberhuber CLA 2008-11-21 06:46:44 EST
Just FYI, I think that on SSH it also only works because a PTY is allocated on the remote side. The literal "Ctrl+C" character is passed the shell channel and interpreted as command to send a signal inside the PTY.

SSH provides an RFC for directly sending signals, and JSch has an API for it, but OpenSSH currently doesn't implement that RFC: 
https://bugzilla.mindrot.org/show_bug.cgi?id=1424

If we want to provide PTY support in Open Source, such that dstore can also interpret the BREAK command, a small C program for PTY support has been contributed to bug 196337, attachment 110783 [details].
Comment 3 David McKnight CLA 2009-03-18 16:05:27 EDT
Created attachment 129282 [details]
patch to end shell process on ctrl+C
Comment 4 David McKnight CLA 2009-03-18 16:07:26 EDT
The fix in the patch does a process.destroy() if there is no pty in responce to the CTRL+C.  I've committed the change to cvs.
Comment 5 Martin Oberhuber CLA 2009-03-19 17:50:26 EDT
This actually made it into M6