/usr.bin/machine/

netbsd
NetBSD fork for lockdoc analysismerlin@scholz.ruhr
summaryrefslogtreecommitdiff
path: root/lib/libcurses/getch.c
AgeCommit message (Collapse)Author
2021-10-19Fix for PR pkg/55931blymn
Don't move the cursor when getch is called if input is not going to be echoed. Lynx uses the cursor to mark the current selection in a pop-up, previously the cursor was being relocated when getch was called which broke the Lynx item marking.
2021-09-06Style fixes most for __CTRACE().rin
2021-09-06Expand __CTRACE() to __nothing #ifndef DEBUG.rin
Remove most of #ifdef DEBUG around __CTRACE() calls. No binary changes, except for line numbers for assert().
2020-07-06Pads are not to be automatically refreshed on input.uwe
X/Open Curses says in the documentation for newpad(): Automatic refreshes of pads (e.g., from scrolling or echoing of input) do not occur. And in the documentation for get*(): If the current or specified window is not a pad, and it has been moved or modified since the last refresh operation, then it will be refreshed before another character is read. From Michael Forney in PR lib/55457
2020-05-14KNF nit.simonb
2019-06-09Rework previous fix for getch cursor position when cursor is movedblymn
without refresh. If the window is not dirty but the window cursor position does not match curscr then move the cursor. This fixes the issues seen in PR lib/54263.
2019-05-20Back out incorrect fix for PR 53617 and fix it in a different way.blymn
Keep track of the cursor location, if getch is called without a refresh and without pending updates (dirty windows) then move the cursor to the correct location directly. Doing this prevents unnecessary refreshes.
2019-03-14Rename global variable "state" to "_cursesi_state".rin
Until now, if application happens to have a global variable of the same name, it was overridden by curses routines. This is the scenario in which aspell crashes when linked to our curses, reported in pkg/44005. We need to wipe out global/static variables like "_cursesi_state" or "wstate" for thread safety. But it would be a future task... XXX pullup to netbsd-8 and netbsd-7
2018-09-28curses: resizeterm(3) should always send KEY_RESIZEroy
Fixes #53636 OK kamil@
2018-09-27curses: call resizeterm if getch issues KEY_RESIZEroy
This fixes PR #53633.
2018-09-27curses: unify resize handling in getchroy
Instead of testing each fgetc call for resize event, add the wrapper __fgetc_resize to simplify the logic. While here, ensure that get_wch uses the correct input stream which may or may not be stdin.
2018-09-26Correct detecting of terminal resize in curses(3) with keypad(,TRUE)kamil
A previous change fixed only keypad(,FALSE) scenarios. Handle catching terminal resize in INKEY_NORM and INKEY_ASSEMBLING (in the middle of assembling a key code from passed codes) as both accept keys with fgetc(3) and both can be in theory interrupted with a resize. PR lib/53615
2018-09-18PR lib/53615rin
getch() and get_wch() should return KEY_RESIZE when interrupted by SIGWINCH. OK roy
2017-01-31Move ESCDELAY to curses.c so all globals are close to each other.roy
Remove _reentrant and use ESCDELAY and TABSIZE as we're not really reentrant.
2017-01-30Check _cursesi_term is set in a few places and sprinkle some static.roy
2017-01-30If either set_escdelay(3) or set_tabsize(3) are called, set _reentrantroy
to ensure we use the saved value for the sceen. This effectively makes ESCDELAY and TABSIZE read-only when either of these functions are called.
2017-01-06KNF.roy
Normalise coding style. White space police. Sprinkle some extra braces to make the flow more clear. No functional changes.
2017-01-05Add the set_escdelay(3) and set_tabsize(3) ncurses extensions.roy
2017-01-01Implement ncurses extension has_key.roy
2012-04-21Add capfile(5) to describe the termcap format.roy
Adjust various man pages and other documentation to point to capfile(5) instead of termcap(5). Remove getcap(3) as curses hasn't been building it for a long time. Punt wrterm.c as tset no longer uses it.
2011-04-21Fix deleting a key definition, it did not work. Also improve tracingblymn
of key definition deletion.
2010-12-07Since limit and l are both unsigned, comparing to 0 doesn't work, so comparejoerg
the values directly.
2010-11-05Don't echo key symbols.blymn
2010-02-03Userland now builds and uses terminfo instead of termcap.roy
OK: core@, jdc@
2009-11-04Read input from the correct FILE.dsl
2009-11-01Move calls to __restore_termios() into the failing path of the functionsdsl
that fail - instead of in most of the callers. All rather pointless if tcsetattr() fails to set the mode we want we are very unlikely to be able to restore any later on.
2009-02-09Fix bug where a single ESC was not recognised when in keypad() mode.jdc
Noticed by abs@.
2008-04-14Add extra debugging information.jdc
2007-12-08Keep pushed-back characters locally. Fixes problems where KEY_* symbolsjdc
are pushed back. Should fix the arrow keys part of PR pkg/37173. While we are here, make getch() and get_wch() check for resize immediately, instead of reading a key, checking for resize and then having to push-back the just read key.
2007-08-28Fix a crash caused by having a single NULL character as a string capability.blymn
This fix is about the best we can do given the current interfaces. We could extend the cgetcap(3) interfaces with a function that would return a character count and handle this in libterm which would provide a more complete fix and allow a NULL character in a string capability.
2007-05-28Merge in wide curses code done as a Summer of Code project byblymn
Ruibiao Qiu.
2007-01-21Add debug "areas" that allow selective debugging by setting thejdc
"CURSES_TRACE_MASK" environment variable. Postive vales include debug areas, negative values exclude them.
2006-07-25PR/34011: Julian Coleman: Limit timeout to 25.5 seconds.christos
2006-03-19Coverity CID 1246: Don't allow getc == -1 to propagate as an array index.christos
2004-03-22Add KEY_RESIZE support and a SIGWINCH handler.jdc
Fixes PR bin/20032. This requires a change to KEY_MAX, which affects libform and libmenu, so we need to change libcurses major number.
2004-03-16Minor style change.jdc
2003-08-07Move UCB-licensed code from 4-clause to 3-clause licence.agc
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-04-08Add ESCDELAY variable to control the inter-key delay in escape sequences.jdc
Fixes PR 20031 by Thomas Klausner.
2003-04-05Keep the cr->nl translation state in a separate variable, so that we canjdc
do the translation ourselves (if the tty didn't do it for us). Add debugging to track functions that change tty state. Fixes PR 20834 by Stephen Borrill.
2003-02-17Fix resize of windows with subwins.dsl
Let window size be given as a -ver number => lines from bottom. Fix trace calls of pointers (approved by Brett Lumn)
2002-12-23Increase default delay when assembling key sequences. This seems tojdc
eliminate the occasional non-recognition of key sequences over remote connections. Okayed by blymn.
2002-10-22Added the ncurses extensions define_key and keyok.blymn
2002-01-02Remove extraneous tabs from blank lines.blymn
2001-12-02* Major change to add support for the newterm/set_term functions.blymn
* Added fix to getch.c suggested by Gabriel Rosenkoetter (thanks :-)
2001-11-01Remove bogus call to free(3) which caused several warning messages intron
application using our "curses" library after the latest change to memory management in the "c" library.