Created attachment 163589 [details] fix for libncurses/libedit interaction gstat includes undocumented keyboard controls for quit [q], filter [f], etc. With (I'm guessing!) recent libedit changes, these commands fail to work as expected. The terminal echoes the single key command, and does not run it until the enter key is pressed. In particular, 'q' 'enter' exits gstat and leaves the terminal in a non-echo state requiring "reset". The attached patch relocates the cbreak() etc. calls after the libedit initialization, and calls cbreak() etc. after libedit is called to enter a new filter.
Created attachment 163600 [details] oops, missed the last part of the patch include the swapped endwin() el_end()
In review at https://reviews.freebsd.org/D6934
A commit references this bug: Author: asomers Date: Thu Jun 23 23:13:14 UTC 2016 New revision: 302162 URL: https://svnweb.freebsd.org/changeset/base/302162 Log: Fix gstat's interactive f and q commands curses and libedit don't play well together. After last year's libedit upgrade in head, they play even less well together. This change resets some curses settings after they get screwed up by libedit calls. Without it, gstat's interactive commands require an extra "enter", screw up the terminal on exit, and screw up the display if the user enters an invalid filter string. PR: 204852 Submitted by: Keith White Reviewed by: pfg Approved by: re (gjb) MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6934 Changes: head/usr.sbin/gstat/gstat.c
Fixed by 302162