Summary: | ee(1) doesn't handle SIGWINCH | ||
---|---|---|---|
Product: | Base System | Reporter: | Alexander Best <alexbestms> |
Component: | bin | Assignee: | Rong-En Fan <rafan> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | ||
Priority: | Normal | ||
Version: | 8.0-CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
Alexander Best
2009-07-01 18:00:09 UTC
what's the status of this PR? i think it really should be fixed before 8.0-RELEASE, because it's really frustrating to lose ee's contents everytime a window gets opened or resized. this will definitely put off user new to freebsd. shipping an OS with a "broken" editor is pretty much unacceptable. alex problem is currently being discussed in this thread: http://lists.freebsd.org/pipermail/freebsd-hackers/2009-October/029796.html Eygene Ryabinkin proposed a patch in this post: http://lists.freebsd.org/pipermail/freebsd-hackers/2009-October/029818.html i can confirm that the patch solves the problem. alex Put the patch to the Web for the easiness: http://codelabs.ru/fbsd/patches/ncurses/ncurses-properly-handle-SIGWINCH.diff -- Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook {_.-``-' {_/ # Author: rafan Date: Mon Oct 26 13:01:29 2009 New Revision: 198489 URL: http://svn.freebsd.org/changeset/base/198489 Log: Pull upstream patch to fix ee(1) crash when received SIGWINCH: modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a SIGWINCH, and discard that value, to avoid confusing application (patch by Eygene Ryabinkin, FreeBSD bin/136223). PR: 136223 Submitted by: Eygene Ryabinkin Obtained from: ncurses-5.7-20091024 snapshot MFC after: 3 days Modified: vendor/ncurses/dist/ncurses/base/lib_getch.c Modified: vendor/ncurses/dist/ncurses/base/lib_getch.c ============================================================================== --- vendor/ncurses/dist/ncurses/base/lib_getch.c Mon Oct 26 11:26:49 2009 (r198488) +++ vendor/ncurses/dist/ncurses/base/lib_getch.c Mon Oct 26 13:01:29 2009 (r198489) @@ -476,6 +476,12 @@ _nc_wgetch(WINDOW *win, /* resizeterm can push KEY_RESIZE */ if (cooked_key_in_fifo()) { *result = fifo_pull(sp); + /* + * Get the ERR from queue -- it is from WINCH, + * so we should take it out, the "error" is handled. + */ + if (fifo_peek(sp) == -1) + fifo_pull(sp); returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK); } } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" Author: rafan Date: Mon Oct 26 13:03:52 2009 New Revision: 198490 URL: http://svn.freebsd.org/changeset/base/198490 Log: Merge r198489 from vendor/ncurses/dist: Pull upstream patch to fix ee(1) crash when received SIGWINCH: modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a SIGWINCH, and discard that value, to avoid confusing application (patch by Eygene Ryabinkin, FreeBSD bin/136223). PR: 136223 Submitted by: Eygene Ryabinkin Obtained from: ncurses-5.7-20091024 snapshot MFC after: 3 days Modified: head/contrib/ncurses/ (props changed) head/contrib/ncurses/ncurses/base/lib_getch.c Modified: head/contrib/ncurses/ncurses/base/lib_getch.c ============================================================================== --- head/contrib/ncurses/ncurses/base/lib_getch.c Mon Oct 26 13:01:29 2009 (r198489) +++ head/contrib/ncurses/ncurses/base/lib_getch.c Mon Oct 26 13:03:52 2009 (r198490) @@ -476,6 +476,12 @@ _nc_wgetch(WINDOW *win, /* resizeterm can push KEY_RESIZE */ if (cooked_key_in_fifo()) { *result = fifo_pull(sp); + /* + * Get the ERR from queue -- it is from WINCH, + * so we should take it out, the "error" is handled. + */ + if (fifo_peek(sp) == -1) + fifo_pull(sp); returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK); } } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" Responsible Changed From-To: freebsd-bugs->rafan I'll take it. State Changed From-To: open->patched change has been committed. Author: rafan Date: Fri Oct 30 17:28:35 2009 New Revision: 198693 URL: http://svn.freebsd.org/changeset/base/198693 Log: MFC r198490 Pull upstream patch to fix ee(1) crash when received SIGWINCH: modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a SIGWINCH, and discard that value, to avoid confusing application (patch by Eygene Ryabinkin, FreeBSD bin/136223). PR: 136223 Submitted by: Eygene Ryabinkin Obtained from: ncurses-5.7-20091024 snapshot Modified: stable/8/contrib/ncurses/ (props changed) stable/8/contrib/ncurses/ncurses/base/lib_getch.c Modified: stable/8/contrib/ncurses/ncurses/base/lib_getch.c ============================================================================== --- stable/8/contrib/ncurses/ncurses/base/lib_getch.c Fri Oct 30 16:59:58 2009 (r198692) +++ stable/8/contrib/ncurses/ncurses/base/lib_getch.c Fri Oct 30 17:28:35 2009 (r198693) @@ -476,6 +476,12 @@ _nc_wgetch(WINDOW *win, /* resizeterm can push KEY_RESIZE */ if (cooked_key_in_fifo()) { *result = fifo_pull(sp); + /* + * Get the ERR from queue -- it is from WINCH, + * so we should take it out, the "error" is handled. + */ + if (fifo_peek(sp) == -1) + fifo_pull(sp); returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK); } } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" Author: rafan Date: Sat Oct 31 12:58:13 2009 New Revision: 198716 URL: http://svn.freebsd.org/changeset/base/198716 Log: MFC r198490 Pull upstream patch to fix ee(1) crash when received SIGWINCH: modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a SIGWINCH, and discard that value, to avoid confusing application (patch by Eygene Ryabinkin, FreeBSD bin/136223). PR: 136223 Submitted by: Eygene Ryabinkin Obtained from: ncurses-5.7-20091024 snapshot Approved by: re (kib@) Modified: releng/8.0/contrib/ncurses/ (props changed) releng/8.0/contrib/ncurses/ncurses/base/lib_getch.c Modified: releng/8.0/contrib/ncurses/ncurses/base/lib_getch.c ============================================================================== --- releng/8.0/contrib/ncurses/ncurses/base/lib_getch.c Sat Oct 31 12:26:40 2009 (r198715) +++ releng/8.0/contrib/ncurses/ncurses/base/lib_getch.c Sat Oct 31 12:58:13 2009 (r198716) @@ -476,6 +476,12 @@ _nc_wgetch(WINDOW *win, /* resizeterm can push KEY_RESIZE */ if (cooked_key_in_fifo()) { *result = fifo_pull(sp); + /* + * Get the ERR from queue -- it is from WINCH, + * so we should take it out, the "error" is handled. + */ + if (fifo_peek(sp) == -1) + fifo_pull(sp); returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK); } } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" State Changed From-To: patched->closed Problem does not exist in 7. Both 8.x and CURRENT had the fix committed last year. Close. |