Bug 204852 - [regression] [patch] fix gstat undocumented keyboard controls
Summary: [regression] [patch] fix gstat undocumented keyboard controls
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Alan Somers
URL:
Keywords: patch, regression
Depends on:
Blocks:
 
Reported: 2015-11-27 19:06 UTC by Keith White
Modified: 2016-06-23 23:15 UTC (History)
1 user (show)

See Also:


Attachments
fix for libncurses/libedit interaction (857 bytes, patch)
2015-11-27 19:06 UTC, Keith White
no flags Details | Diff
oops, missed the last part of the patch (965 bytes, patch)
2015-11-27 21:40 UTC, Keith White
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith White 2015-11-27 19:06:36 UTC
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.
Comment 1 Keith White 2015-11-27 21:40:03 UTC
Created attachment 163600 [details]
oops, missed the last part of the patch

include the swapped endwin() el_end()
Comment 2 Alan Somers freebsd_committer freebsd_triage 2016-06-23 15:22:40 UTC
In review at https://reviews.freebsd.org/D6934
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-06-23 23:13:42 UTC
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
Comment 4 Alan Somers freebsd_committer freebsd_triage 2016-06-23 23:15:38 UTC
Fixed by 302162