Created attachment 401427 [details] my fix, seems to work for me Description of problem: The "sftp" command is terminated if you resize the graphical terminal (xterm, gnome-terminal) it is running in, returning you to the shell. The bug appears to be within libedit, because examples/fileman within the libedit source has the same problem. Version-Release number of selected component (if applicable): libedit-3.0-1.20090923cvs.fc13 How reproducible: Always Steps to Reproduce: 1. Start gnome-terminal 2. sftp 127.0.0.1 3. Resize the gnome-terminal, changing the number of rows or columns of text Actual results: sftp exits normally, returning you to the shell Expected results: sftp continues running Additional info: Fedora 12's libedit-2.11-4.20080712cvs.fc12 doesn't have this bug. There are significant changes in signal handling between the libedit versions, my fix seems to work, but is more of a workaround, it puts back the signal handlers, similar to existing code for SIGCONT.
(In reply to comment #0) > Created an attachment (id=401427) [details] > my fix, seems to work for me Thank you for filling the bug and preparing the patch! > Description of problem: > The "sftp" command is terminated if you resize the graphical terminal (xterm, > gnome-terminal) it is running in, returning you to the shell. Confirmed. It's really annoying. > The bug appears to be within libedit, because examples/fileman within the > libedit source has the same problem. Indeed. It works well again after libedit downgrade. > Additional info: > Fedora 12's libedit-2.11-4.20080712cvs.fc12 doesn't have this bug. There are > significant changes in signal handling between the libedit versions, my fix IMO this is the relevant one: --- a/src/read.c +++ b/src/read.c @@ -172,7 +172,7 @@ read__fixio(int fd __attribute__((__unused__)), int e) return (e ? 0 : -1); case EINTR: - return (0); + return (-1); default: return (-1); > seems to work, but is more of a workaround, it puts back the signal handlers, > similar to existing code for SIGCONT. It makes sense to me since SIGWINCH is the only signal which is not supposed to break the loop from all the 7 signals listed in src/sig.h. I'll propose the patch upstream, adding you to CC.
Created attachment 402041 [details] revised patch Based on Kamil's comment #1, it has occurred to me that the call to sig_set() in the original patch is unnecessary (there's probably nothing wrong in all the changes to sig.c). I tested the revised patch and it still works.
Comment on attachment 402041 [details] revised patch Looks good to me.
After more thorough testing, the revised patch doesn't solve the problem completely. With the revised patch, although sftp doesn't exit after the first resize, it will still exit on a resize that follows a completed "put" command, even though you are back at the same "sftp>" prompt. I have re-instated the original patch.
Good catch! Thanks for the thorough testing. Let's give some time to upstream folks now so that they look at the bug and the solution.
built as libedit-3.0-2.20090923cvs.fc14 http://koji.fedoraproject.org/koji/buildinfo?buildID=164510 The update for F-13 will follow.
libedit-3.0-2.20090923cvs.fc13 has been submitted as an update for Fedora 13. http://admin.fedoraproject.org/updates/libedit-3.0-2.20090923cvs.fc13
libedit-3.0-2.20090923cvs.fc13 has been pushed to the Fedora 13 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update libedit'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/libedit-3.0-2.20090923cvs.fc13
libedit-3.0-2.20090923cvs.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.