[issue23735] Readline not adjusting width after resize with 6.3

2016-04-03 Thread Martin Panter
Martin Panter added the comment: Thanks for pointing that out Serhiy. It turns out sighandler_t is non-standard. My latest tweak seems to have fixed things. Also thankyou Eric for your persistence with this patch :) -- resolution: -> fixed stage: patch review -> resolved status: open

[issue23735] Readline not adjusting width after resize with 6.3

2016-04-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset e3f375047edf by Martin Panter in branch '3.5': Issue #23735: Avoid sighandler_t Gnu-ism https://hg.python.org/cpython/rev/e3f375047edf New changeset 0e576d094dc4 by Martin Panter in branch 'default': Issue #23735: Merge sighandler_t fix from 3.5

[issue23735] Readline not adjusting width after resize with 6.3

2016-04-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: http://buildbot.python.org/all/builders/AMD64%20OpenIndiana%203.x/builds/10490/steps/compile/logs/warnings%20%282%29 /export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Modules/readline.c:939: warning: implicit declaration of function

[issue23735] Readline not adjusting width after resize with 6.3

2016-04-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset b29edd0108ee by Martin Panter in branch '3.5': Issue #23735: Add SIGWINCH handler for Readline 6.3+ support, by Eric Price https://hg.python.org/cpython/rev/b29edd0108ee New changeset 41c2f8742bfe by Martin Panter in branch 'default': Issue #23735:

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-27 Thread Martin Panter
Martin Panter added the comment: Sorry I forgot to send my draft. Sent now, but you figured it out :) -- ___ Python tracker ___

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-27 Thread Eric Price
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:

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-27 Thread Martin Panter
Martin Panter added the comment: I think this version is pretty good. I would move the signal restoring bit to the end of the handler (see review), and there is some funny indentation, but I can fix that up when I commit it. -- ___ Python tracker

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-26 Thread Eric Price
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

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-25 Thread Martin Panter
Martin Panter added the comment: Unfortunately, yes I think another test might be needed in configure.ac, unless you can piggy-back on one of the existing flags. One more thing that I thought of: Looking at the main Python signal handler, it reinstalls itself, see

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-22 Thread Eric Price
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? -- ___

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-22 Thread Eric Price
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

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-22 Thread Martin Panter
Martin Panter added the comment: Issue 13285 is open about tracking non-Python signal handlers. I also found Issue 2675 about curses SIGWINCH handling in the interactive interpreter or when the readline module is imported, and Issue 3948 about someone trying to use both readline and SIGWINCH.

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-22 Thread Martin Panter
Martin Panter added the comment: In configure.ac there are explicit checks for pre-2.1 Readline versions (and later versions). Maybe it is reasonable to require 4.0 these days. But I think this should only be done in the next Python version (3.6+). To support Editline (and pre-4.0 Readline

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-22 Thread Eric Price
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

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-22 Thread Martin Panter
Martin Panter added the comment: I think it is conceivable that people could use Readline _and_ do their own stuff with the terminal. Consider someone playing with terminal stuff in the interactive interpreter (which happens to use Readline). I understand Readline returns the terminal to a

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-16 Thread Christian Zommerfelds
Christian Zommerfelds added the comment: This bug makes the REPL totally unusable because larger lines start to wrap in a very strange and unreadable way. What has to be done in order for this to get accepted? It looks like there is no better way to define the signal handler and that the user

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-16 Thread Christian Zommerfelds
Changes by Christian Zommerfelds : -- nosy: +Christian Zommerfelds ___ Python tracker ___

[issue23735] Readline not adjusting width after resize with 6.3

2016-02-01 Thread Tiago Peixoto
Changes by Tiago Peixoto : -- nosy: +count0 ___ Python tracker ___ ___ Python-bugs-list

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-27 Thread Martin Panter
Martin Panter added the comment: How does this patch affect a user-defined SIGWINCH handler, or is that not really supported when Readline is in use? -- stage: needs patch -> patch review ___ Python tracker

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-27 Thread Eric Price
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

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-27 Thread Eric Price
Changes by Eric Price : Removed file: http://bugs.python.org/file40844/rl_sigwinch_update.patch ___ Python tracker ___

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-27 Thread Eric Price
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

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-22 Thread Josh Rosenberg
Josh Rosenberg added the comment: Patch doesn't let me comment, but I believe to be strictly standards conformant, sigwinch_received should be declared as a `volatile sig_atomic_t`, not `char`. See:

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-22 Thread Josh Rosenberg
Josh Rosenberg added the comment: Okay, sorry for repeated nitpicks, but I think you can keep the visibility of sigwinch_received as static like it was as char (to avoid having it be exported for potential use by other modules, though it won't gain any optimization benefits of static, since

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-22 Thread Eric Price
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

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-22 Thread Eric Price
Changes by Eric Price : Removed file: http://bugs.python.org/file40843/rl_sigwinch_update.patch ___ Python tracker ___

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-22 Thread Eric Price
Changes by Eric Price : Removed file: http://bugs.python.org/file40837/rl_sigwinch_update.patch ___ Python tracker ___

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-22 Thread Eric Price
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

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-22 Thread Eric Price
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

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-16 Thread John Morrissey
Changes by John Morrissey : -- nosy: +johnmorr ___ Python tracker ___ ___ Python-bugs-list

[issue23735] Readline not adjusting width after resize with 6.3

2015-10-16 Thread Martin Panter
Martin Panter added the comment: One idea might be to synchronously poll the screen size each time before Readline is invoked. Would doing this be such a burden? The polling could be limited to once every 0.1 s or so if it was a big burden. These ways would avoid interfering with signal

[issue23735] Readline not adjusting width after resize with 6.3

2015-03-21 Thread R. David Murray
R. David Murray added the comment: Why would this not constitute a bug in readline? Readline isn't going to be active all of the time in most applications, so why shouldn't it be readline's responsibility to install the signal handler at initialization and handle it? If the application

[issue23735] Readline not adjusting width after resize with 6.3

2015-03-21 Thread Carlos Pita
New submission from Carlos Pita: See here: https://github.com/ipython/ipython/issues/6974 Chet Ramey confirmed the bug is downstream: As I recall from looking briefly at the ipython/python source code, it has to do with python not handling the SIGWINCH and expecting readline to do it even

[issue23735] Readline not adjusting width after resize with 6.3

2015-03-21 Thread Carlos Pita
Carlos Pita added the comment: Chet again: Here's the story from the top. Prior to readline-6.3, readline could `steal' signals from the calling application in the sense that readline's signal handler got a crack at all signals in which readline was interested before the application did. Now,

[issue23735] Readline not adjusting width after resize with 6.3

2015-03-21 Thread R. David Murray
R. David Murray added the comment: If it used to handle the signal and then re-raise it, why doesn't it now set its flag and then re-raise the signal? (I also don't understand why the API isn't that the application takes back the signal handler if it needs it if it is using readline, but I'm

[issue23735] Readline not adjusting width after resize with 6.3

2015-03-21 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23735 ___ ___ Python-bugs-list