[issue23735] Readline not adjusting width after resize with 6.3
Eric Price added the comment: This patch seems to fix the issue for me, by installing a signal handler for SIGWINCH that sets a flag which is checked while waiting for input. One could make a simpler patch that just calls rl_resize_terminal() from the signal handler. That would essentially replicate the pre-readline 6.2 behavior, which worked fine, but supposedly it's `dangerous'. -- keywords: +patch nosy: +Eric Price Added file: http://bugs.python.org/file40837/rl_sigwinch_update.patch ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23735] Readline not adjusting width after resize with 6.3
Eric Price added the comment: Right, thanks, I've updated the patch. -- Added file: http://bugs.python.org/file40843/rl_sigwinch_update.patch ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23735] Readline not adjusting width after resize with 6.3
Changes by Eric Price : Removed file: http://bugs.python.org/file40837/rl_sigwinch_update.patch ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23735] Readline not adjusting width after resize with 6.3
Changes by Eric Price : Removed file: http://bugs.python.org/file40843/rl_sigwinch_update.patch ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23735] Readline not adjusting width after resize with 6.3
Eric Price added the comment: Hmm, hopefully the review tool works now. (I was generating the patch manually from a source tarball, not a checkout.) -- Added file: http://bugs.python.org/file40844/rl_sigwinch_update.patch ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23735] Readline not adjusting width after resize with 6.3
Eric Price added the comment: SIGWINCH handler for readline. Fixed indentation issues. -- Added file: http://bugs.python.org/file40870/rl_sigwinch_update.patch ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23735] Readline not adjusting width after resize with 6.3
Changes by Eric Price : Removed file: http://bugs.python.org/file40844/rl_sigwinch_update.patch ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23735] Readline not adjusting width after resize with 6.3
Eric Price added the comment: At the moment, it just overwrites any existing SIGWINCH handler. I don't know how to do anything better -- one could try to store an existing SIGWINCH handler and call it, but it still wouldn't really work for an application that wanted to add and remove handlers. I think such applications are rare, though -- readline mucks with the terminal in various ways, so it's unlikely that other applications will also muck with the terminal and expect to be compatible with it. -- ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23735] Readline not adjusting width after resize with 6.3
Eric Price added the comment: rl_resize_terminal was added in readline 4.0, released in 1999. I think we can rely on it. =) I don't know editline, but it probably doesn't include the readline 6.3 change that makes this necessary, so your patch for it could just IFDEF out that line. I think SIG_DFL is a pretty reasonable return value, actually. It's clearly not SIG_IGN or a python handle, it's not really "unknown", and it can be described as default behavior: it is the default way readline is supposed to work. Finally, while I agree that it is conceivable that one could try to use readline + other terminal mucking with SIGWINCH, (a) this didn't work before the 6.3 change, (b) it doesn't work now, (c) it's far less common than the standard case of using readline normally, and (d) supporting such usage would be complicated and require a readline module API change. Let's start by supporting normal usage. -- ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23735] Readline not adjusting width after resize with 6.3
Eric Price added the comment: Hmm, OK. I've made a new version of the patch that chains signal handlers. I think that should make it match previous functionality, and work with basic combined usage or python signal handlers. It probably still won't work if you, say, want to start and then stop a signal handler installed in C, but that's basically Issue 13285. -- Added file: http://bugs.python.org/file42246/rl_sigwinch_calling_old_handler.patch ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23735] Readline not adjusting width after resize with 6.3
Eric Price added the comment: (To be clear, it now works in general for Python signal handlers, and when C handlers are inserted but not deleted.) For a conditional ifdef, does that mean I should add another test/variable in configure.ac? -- ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23735] Readline not adjusting width after resize with 6.3
Eric Price added the comment: Well, I could piggyback on the existing flags if I just wanted to support readline -- there are already two flags for readline 4.0 -- but if our real goal is to be compatible with editline, we probably need another flag. I think you're right that it should reinstall itself, in case it's installed using signal(). I've made a new patch that includes a config flag and puts everything inside the ifdefs. -- Added file: http://bugs.python.org/file42302/rl_sigwinch_version_3.patch ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23735] Readline not adjusting width after resize with 6.3
Eric Price added the comment: Hmm, I'm not seeing comments in the review? You're right about the order. When we don't have sigaction, python's signal handler will reinstall itself, so we need to reinstall this one after calling the old handler. -- Added file: http://bugs.python.org/file42307/rl_sigwinch_version_4.patch ___ Python tracker <http://bugs.python.org/issue23735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com