Commit Graph

484 Commits

Author SHA1 Message Date
christos 28ef40ccbd fix pasto 2011-01-28 03:41:52 +00:00
christos b2ce31d086 don't turn on editing if stdout is not a tty. 2011-01-27 23:11:40 +00:00
christos 7350622ee8 off by one in fetching history data. From: Gerry Swislow 2011-01-16 03:05:51 +00:00
wiz 3d3c5d42cb Observe the following spelling:
- wide character (noun)
- wide-character (adjective)

Inspired by jmc@OpenBSD.
2010-12-16 17:42:25 +00:00
dholland eb1ab8ee50 Improve previous to avoid changing the interface of an externally
exposed function. (But note that this function is neither documented
nor declared in any installed header file, and it probably should not
be externally exposed.) Related to PR 44183, closes PR 44186.
2010-12-06 00:05:38 +00:00
dholland 574c2fc5a2 add const, from PR 44183. 2010-12-02 04:42:46 +00:00
dholland 92417c82c1 Fix up bodgy code for printing completion matches; it used to sometimes
skip entries, print (null), run off the end of the array, or occasionally
receive SIGSEGV, and now will, hopefully at least, do none of that.

Based in part on the patch in PR 44183 from Sergio Acereda; I also
did some tidyup and fixed it to print top-to-bottom first like ls(1).
2010-12-02 04:35:17 +00:00
christos a85c37d8d9 don't increment i twice in the loop. From Michael Byrnes 2010-11-15 21:24:31 +00:00
christos 9bc86f7706 PR/43998, PR/44021: In narrow history emulation, don't treat UTF-8 character
sets specially as far as history goes since we always need to do the conversion
from narrow [history] to wide [editline].
2010-11-04 13:53:12 +00:00
christos f70a466a92 fix fd leak found by Igor Zinovik 2010-10-23 23:27:40 +00:00
christos b354315033 unbreak readline history. 2010-09-16 20:08:51 +00:00
christos 7741aae941 setup a callback to be invoked on resize buffers so that readline can
reset rl_line_buffer which unfortunately some applications use it directly.
2010-08-28 15:44:59 +00:00
christos 6e1c968db3 provide rl_on_newline 2010-08-04 20:29:18 +00:00
christos 0ccb4e68f8 refresh only on SIGCONT not SIGWINCH from Edward Sheldrake 2010-07-21 18:18:52 +00:00
christos c157529beb retry the read after sigwinch too, from Edward Sheldrake 2010-07-19 17:18:13 +00:00
christos cbd798c94b tidy up memory allocation and don't unnecessarily print "./" before names. 2010-06-01 18:20:26 +00:00
christos ca8b6091c1 Use the same hack for Solaris and MacOS/X. This is not right, we only really
support UTF-8, but it will get us going until this is fixed properly.
From Jess Thrysoee
2010-04-20 02:01:13 +00:00
christos 72c00e4a7a \033 is more portable than \e still. 2010-04-18 21:17:47 +00:00
christos df810c5405 ffs needs strings.h 2010-04-18 21:17:22 +00:00
christos d29e250074 shame on solaris that is the last OS not supporting $() 2010-04-18 21:17:05 +00:00
christos 839bac947e From Jess Thrysoee
- Fix wint_t to Int confusion
2010-04-15 00:57:33 +00:00
christos 5443e9b772 From Jess Thrysoee
- use nl_langinfo to test for UTF-8, because some locales are UTF-8 without
     reflecting it in their names.
2010-04-15 00:56:40 +00:00
christos a5b37ffc65 From Jess Thrysoee
expose ct_enc_width()
2010-04-15 00:55:57 +00:00
christos 939651fa2b From Jess Thrysoee
- NARROW_HISTORY and IGNORE_EXTCHARS should not take effect if locale is UTF-8
- account for multi byte char length in
2010-04-15 00:52:48 +00:00
christos b77d4fa5c5 From Jess Thrysoee: call setlocale so we can test UTF-8 2010-04-15 00:50:46 +00:00
christos a9dd944f6b From Jess Thrysoee: add ifndef around def of _GNU_SOURCE 2010-04-15 00:50:03 +00:00
christos f576147073 https://bugzilla.redhat.com/show_bug.cgi?id=575383
Handle EINTR properly.
2010-03-22 22:59:06 +00:00
roy 98eb889579 Userland now builds and uses terminfo instead of termcap.
OK: core@, jdc@
2010-02-03 15:34:37 +00:00
christos 6fbbcd94ce PR/42646: Joachim Kuebart: Shell crashes in libedit when window size changes
(SIGWINCH). Return NULL if el_gets() gets interrupted.
2010-01-20 01:15:52 +00:00
christos 654f9c04e7 Fix wrapper for EL_EDITOR, from Michael L. Hitch 2010-01-19 22:38:08 +00:00
christos 081c24c702 PR/42637: Joachim Kuebart: Shell tab completion crashes due to libedit stack
smashing
2010-01-18 19:17:42 +00:00
christos 139d3d5a3b - call the mapping function directly instead of el_wset().
- save the strings passed to the mapping function so that they don't get
  re-used. This leaks. To fix it properly we could either pass a flag to
  free particular entries before re-using, or allocate all of them.
  Allocating all of them wastes memory, allocating some of them makes
  the code more complex.
This fixes compatibility binding (shell tab completion for example)
2010-01-12 19:40:50 +00:00
christos c9043bbf6e - in the argv conversion, handle NULL as NULL
- when printing tab/nl print them, don't handle them specially.
2010-01-12 19:37:18 +00:00
wiz 0d3270a169 Bump date for historyw -> history_w. 2010-01-03 19:05:26 +00:00
christos 73eda9fe27 rename historyw -> history_w for consistency.
add wide tst code and make it the default.
2010-01-03 18:27:10 +00:00
christos 4168f34493 expose the encode and decode string functions for the benefit of history
and readline.
2009-12-31 18:32:37 +00:00
christos dc8498bec8 - Document and enable wide character support.
- Fix read function compatibility.
2009-12-31 15:58:26 +00:00
christos 0b9ae3fdf0 Fix wide build, test it, but don't turn it on yet. 2009-12-30 23:54:52 +00:00
christos 34e53048e6 Wide character support (UTF-8) from Johny Mattsson; currently disabled. 2009-12-30 22:37:40 +00:00
christos 8106943a02 reduce diff with tcsh 2009-12-28 22:15:36 +00:00
christos b90e7198e7 improve on the listing display by printing only one character after the
filename not two, and no trailing blanks. I will revisit this when I write
the ls-F code.
2009-12-28 21:55:38 +00:00
christos c8b67cd8d5 Reduce diff with tcsh's editor. No functional change intended. 2009-12-28 21:54:21 +00:00
christos 969676ec74 Fix bug where tab completion on the second or > line that caused listing
ended up corrupting the display by an extra space in the beginning. Reported
by Mac Chan.
2009-12-28 21:52:43 +00:00
christos ea3813ed2f apply apple patches from:
http://opensource.apple.com/source/libedit/libedit-11/patches/
2009-09-07 21:24:33 +00:00
christos 461d0372fd delete defined(sun), it could be invaded in the user namespace. Suggested
by mrg@
2009-08-31 00:05:43 +00:00
christos 5aa87ec494 use __sun || sun instead of _SunOS, from Jess Thrysoee 2009-08-30 15:41:05 +00:00
christos 085c78fd1f Ignore comment lines in .editrc from Jess Thrysoee 2009-07-25 21:19:23 +00:00
christos bafe66c2cc Only need path if we have issetugid... From Anon Ymous 2009-07-22 18:25:26 +00:00
christos e304eddfd2 Don't depend on side effects inside an assert
From Michael Cook mcook at bbn dot com
2009-07-22 15:58:09 +00:00
christos cfa16c6369 Fix memory leaks in error paths.
From Michael Cook mcook at bbn dot com
2009-07-22 15:57:40 +00:00