You are not logged in.

#1 2017-08-28 18:24:42

vociferos
Member
Registered: 2016-12-05
Posts: 6

Latest ncurses confuses weechat

The latest ncurses in testing, ncurses-6.0+20170827-1, horribly breaks weechat rendering after the window is resized around a bit -- specifically, i3 titlebars being added/removed from the workspace resizes the window.
The previous ncurses-6.0+20170527-1 works just fine.

I bisected the ncurses releases and tracked it down to the 20170722 changeset, which included changes to endwin. Only weechat seems to have any weird behavior, which makes me think there is some specific unusual way weechat is using ncurses. At this point I'm really not sure yet where to report bugs and need to investigate it further, but I would appreciate any help figuring this out in the meantime.

Offline

#2 2017-08-29 05:26:52

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Latest ncurses confuses weechat

I get the same issue when running weechat in guake, and resizing the window from halfscreen to fullscreen.

CTRL+L redraws everything, fixing it, but I also notice that resizing it back to halfscreen doesn't break it and in fact fixes it.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2017-08-29 16:29:43

vociferos
Member
Registered: 2016-12-05
Posts: 6

Re: Latest ncurses confuses weechat

I did some more poking around the ncurses source code. The 2017-07-22 patchset switched an internal state flag "_endwin" from a TRUE/FALSE value to a tristate enum. One of the comparisons appears inadvertently inverted, so that a code path runs in the opposite state from before.

Relevant part of the patch (in ncurses-6.0-20170722/ncurses/tty/tty_update.c):

@@ -816,7 +816,8 @@
 	SP_PARM->_fifohold--;
 
 #if USE_SIZECHANGE
-    if (SP_PARM->_endwin || _nc_handle_sigwinch(SP_PARM)) {
+    if ((SP_PARM->_endwin == ewRunning)
+	|| _nc_handle_sigwinch(SP_PARM)) {
 	/*
 	 * This is a transparent extension:  XSI does not address it,
 	 * and applications need not know that ncurses can do it.

_endwin was being compared to TRUE, which now corresponds to ewSuspend, but is now compared to ewRunning (approximately the old FALSE).

Adding a sed line to the PKGBUILD seems to work around it for now and restore the old behavior:

prepare() {
  cd $pkgname-${_pkgver}
  sed -i 's/== ewRunning/== ewSuspend/' ncurses/tty/tty_update.c
}

I will send this on to the ncurses mailing list to get some clarification.

Offline

#4 2017-08-30 01:35:41

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,384
Website

Re: Latest ncurses confuses weechat

Oh...  Arch is using developmental patchsets...  I am surprised this is the first API break we have seen.

Offline

#5 2017-09-03 16:07:21

vociferos
Member
Registered: 2016-12-05
Posts: 6

Re: Latest ncurses confuses weechat

I got a response on the ncurses mailing list and the fix was included in the 20170902 patches, so I flagged ncurses out-of-date again. It did feel weird asking for another development patch release, but ncurses hasn't had a full release in over two years after all.

Offline

#6 2017-09-04 20:25:59

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Latest ncurses confuses weechat

Well, ncurses has been bumped again to 20170902-1 and this is fixed, so yay. smile


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB