1This file lists major changes which accompany each new release. 2 3Version 1.6.3: 4 5 This release corrects some problems in the build process, 6 including one that was preventing libtecla from being compiled 7 on Mac OS X. 8 9Version 1.6.2: 10 11 This release updates the configuration script to ensure that the 12 enhance utility program is compiled correctly on systems that have 13 system V psuedo-terminal allocation but not system V streams. 14 15 There are no new features. 16 17Version 1.6.1: 18 19 This is primarily a minor bug-fix release. 20 21 One added feature is the ability to call gl_normal_io() from 22 callbacks registered by gl_watch_fd() and 23 gl_inactivity_timeout(). This allows these callbacks to cleanly 24 suspend line editing before either reading from the terminal, or 25 writing to the terminal; and then subsequently causes the input line 26 to be automatically redisplayed, and line-editing to be resumed by 27 gl_get_line(), as soon as the callback returns. 28 29 Another minor change is that if the terminal type specified in the 30 TERM environment variable is set to "dumb", gl_get_line() now treats 31 the terminal as though it were a non-interactive stream, rather than 32 treating it as a VT100-compatible terminal. This means that it 33 doesn't either prompt for input, or perform any command-line 34 editing, even when it really is interacting with a terminal. This is 35 aimed at the rare situation where a third-pary program that connects 36 to libtecla through an embedded pseudo-terminal, needs to be forced 37 to behave as though it weren't talking to a terminal, in order that 38 it be useable in non-interactive scripts. 39 40 Note that in the previous release, the optional configuration 41 function, gl_tty_signals(), was incorrectly swapping the suspend and 42 terminal signal handlers before installing them. 43 44 A configuration problem that prevented select() from being used 45 under MacOS X, has been fixed. 46 47 Although not documented in the man page, it was meant to be possible 48 to take the input line that one call to gl_get_line() returned, and 49 ask the next call to gl_get_line() to present it back to the user 50 for re-editing, simply by passing the pointer returned by one call 51 to gl_get_line() as the start_line argument of the next call to 52 gl_get_line(). This feature unfortunately stopped working in 1.6.0, 53 so this release restores it, and officially documents it in the man 54 page documentation of gl_get_line(). 55 56 In the previous version of the library, calling gl_terminal_size() 57 on a system without SIGWINCH support, would crash the 58 application. This has been fixed. 59 60 Libtecla now apparently compiles cleanly under IRIX. 61 62Version 1.6.0: 63 64 This release is primarily a bug-fix release. However there are also 65 four new functions, so the minor version number has been 66 incremented to reflect this. 67 68 Two of the new functions are gl_automatic_history() and 69 gl_append_history(). The former of these functions allows the 70 application to tell gl_get_line() not to automatically archive 71 entered lines in the history list. The second of these functions 72 allows the application to explicitly append a line to the history 73 list. Thus together, these two functions allow the calling 74 application to take over control of what is placed in the history 75 list. 76 77 The third new function is gl_query_char(), which prompts the user 78 for a single character reply, which the user can then type without 79 having to hit return to enter it. Unless echoing is disabled, the 80 character that is entered is then displayed after the prompt, 81 and a newline is started. 82 83 Finally, the 4th new function is gl_read_char(), which also reads 84 a single character from the user, but doesn't prompt the user, write 85 anything to the terminal, or disturb any partially entered input 86 line. It is thus safe to call this function not only from between 87 calls to gl_get_line(), but also from application callback 88 functions, even if gl_normal_io() hasn't been called. 89 90 When using the history-search-backwards or history-search-forwards 91 actions, if the search prefix that the user typed, contains any of 92 the *,? or [ globbing characters, it is now treated as a glob 93 pattern to be matched against historical lines, instead of a simple 94 prefix. 95 96 I have added a --without-file-system option to the configure 97 script. This is intended for use in embedded systems that either 98 don't have filesystems, or where the file-system code in libtecla is 99 seen as unwanted bloat. See the INSTALL document for details. 100 101 Similarly, I also added a --without-file-actions option to the 102 configure script. This allows the application author/installer to 103 prevent users of gl_get_line() from accessing the filesystem with 104 the builtin actions of gl_get_line(). It does this by removing a 105 number of action functions, such as expand-filename, and list-glob, 106 and by changing the default behavior of other actions, such as 107 complete-word and list-or-eof, to show no completions. 108 109 Now to the bugs that have been fixed. Version 1.5.0 had a lot of big 110 internal changes, so there are a number of bugs that needed to be 111 fixed. There was a bug which caused a crash if gl_load_history() 112 was called multiple times. There was another bug which caused a 113 prompt not to be displayed on the next line after switching from 114 reading input from a file to reading from the terminal. Also, in 115 tecla configuration files, backslash escaped characters within 116 key-binding key-sequences weren't being escaped. Thus ^\\ got 117 interpretted as a control-\ followed by a \ character instead of as 118 a control-\. There was a bug in the history recall mechanism which 119 caused the search prefix to be forgotten in certain complicated 120 usage scenarios. There was a minor memory leak in the 121 gl_configure_getline() function. Finally, if gl_get_line() was 122 aborted by a signal, or any other abnormal event, the value of errno 123 which originally indicated what had happened, got zeroed by the 124 code that restored the terminal to a usable state. Thus the 125 application couldn't figure out what had caused the error, apart 126 from by looking at gl_return_status(). All of these bugs have been 127 fixed. 128 129 In the Makefile, there were a number of places where install-sh was 130 invoked without a path prefix. This has now been remedied. 131 132 A fully functional workaround for a bug in Solaris' terminal I/O 133 code has also been implemented. This bug, which only manifested 134 itself in libtecla's uncommonly used non-blocking server I/O mode, 135 caused characters entered while in normal I/O mode, between calls to 136 gl_get_line() to be invisible to the next call to gl_get_line(), 137 until the user typed at least one more key after raw terminal mode 138 was restored. 139 140 The Gnu autoconf config.guess and config.sub scripts have been 141 updated to their latest versions. Apparently the old versions that I 142 was previously using were too old to know about certain BSD ports. 143 144Version 1.5.0: 145 146 This release includes several major new features for those using 147 gl_get_line(), shared library support in Darwin, better cross 148 compilation support, and various minor bug fixes. 149 150 The biggest new feature is the option of a non-blocking I/O mode, in 151 which gl_get_line() can safely be called from an application's 152 external event-loop to incrementally read input lines from the user. 153 This feature is documented in the gl_io_mode(3) man page. 154 155 In addition, there is now support for the definition of additional 156 word-completion action functions, which can then be bound to 157 different keys. See the documentation of the gl_completion_action() 158 function in the gl_get_line(3) man page. 159 160 Externally defined action functions can also be defined, although 161 presently they don't have write access to the input line, so they 162 are restricted to operations that display information text to the 163 terminal, or modify the environment of the calling application in 164 some way. See the documentation of the gl_register_action() function 165 in the gl_get_line(3) man page. 166 167 Some of the non-blocking I/O support functions can also be used for 168 improved signal handling in the normal blocking mode. In particular, 169 the gl_list_signals() and gl_catch_blocked() functions make it 170 easier to write reliable signal handling around gl_get_line(). The 171 new "RELIABLE SIGNAL HANDLING" section of the gl_get_line(3) man 172 page is intended as an introduction to this subject. 173 174 Programs can now clear the terminal between calls to gl_get_line(), 175 by calling the new gl_erase_terminal() function. 176 177 The gl_display_text() function, now used in the demos to display 178 introductory banners, is provided for formatting text according to 179 the width of the terminal. 180 181 It is now possible to install inactivity timeout callbacks in 182 gl_get_line(), using the new gl_inactivity_timeout() function. 183 184 The new gl_set_term_size() function allows the application to 185 explicitly set the terminal size, for cases, such as when one is 186 using a terminal at the end of a serial lineq, where the terminal 187 driver doesn't send the process a SIGWINCH when the terminal size 188 changes. 189 190 The new gl_bind_keyseq() function provides a convenient 191 alternative to gl_configure_getline(), for binding or unbinding 192 one key-sequence at a time. 193 194 gl_get_line()s signal handling, file-descriptor event-handling, 195 inactivity-timeout handling and server-mode non-blocking I/O 196 features now not only work when input is coming from a terminal, but 197 now also work when input is coming from non-interactive streams, 198 such as files and pipes. 199 200 The history implementation has been re-written to make it more 201 efficient and easier to modify. The biggest user-level change is 202 that when recalling history lines using a search prefix, the same 203 line is no longer returned more than once in a row. Previously this 204 duplicate elimination only worked when one was recalling a line 205 without specifying a search prefix, and this was naively performed 206 by preventing neighboring duplicates from existing in the history 207 list, rather than by skipping duplicates at search time. 208 209 In previous versions of the library, when gl_get_line() and its 210 associated public functions detected invalid arguments, or couldn't 211 allocate memory, etc, error messages were written to stderr. This 212 isn't appropriate for library functions, so instead of writing such 213 messages to stderr, these messages are now recorded in buffers 214 within the affected GetLine object. The latest error message can 215 then subsequently be queried by calling gl_error_message(). The use 216 of errno has also been expanded, and a new function called 217 gl_return_status() has been provided to expand on the cause of the 218 last return from gl_get_line(). 219 220 User level usage and configuration information has now been split 221 out of the gl_get_line(3) man page into a separate tecla(7) man 222 page. The enhance(3) man page has also been renamed to enhance(1). 223 224 When expanding "~/", gl_get_line() now checks for, and returns the 225 value of the HOME environment variable, if it exists, in preference 226 to looking up the directory of the current user in the password 227 file. 228 229 When the terminal was resized to a narrower width, previous versions 230 of gl_get_line() would redraw the line higher up the terminal. This 231 bug has been fixed. A bug in history recall has also been fixed, in 232 which an error message was being generated if one attempted to 233 recall a line while the cursor was at the end of the longest 234 possible input line. A more serious bug, in which callbacks 235 registered by gl_watch_fd() weren't being called for write-events, 236 has also been fixed. Finally, a few minor fixes have been made to 237 improve support under QNX and Mac OS X. 238 239 Beware that in this release, much of the underlying code has 240 undergone some radical re-work, so although backwards compatibility 241 of all documented features has been preserved, there may be some 242 lingering bugs that could break existing programs. So, if you plan 243 to use this version in production code, please test it as far as 244 possible within your application before releasing it to your 245 clients, and as always, please report any unexpected behavior. 246 247Version 1.4.1: 248 249 This is a maintenance release. It includes minor changes to support 250 Mac OS X (Darwin), the QNX real-time operating system, and Cygwin 251 under Windows. It also fixes an oversight that was preventing the 252 tab key from inserting tab characters when users unbound the 253 complete-word action from it. 254 255Version 1.4.0: 256 257 The contents of the history list can now be saved and restored with 258 the new gl_save_history() and gl_load_history() functions. 259 260 Event handlers can now be registered to watch for and respond to I/O 261 on arbitrary file descriptors while gl_get_line() is waiting for 262 terminal input from the user. See the gl_get_line(3) man page 263 for details on gl_watch_fd(). 264 265 As an optional alternative to getting configuration information only 266 from ~/.teclarc, the new gl_configure_getline() function allows 267 configuration commands to be taken from any of, a string, a 268 specified application-specific file, and/or a specified 269 user-specific file. See the gl_get_line(3) man page for details. 270 271 The version number of the library can now be queried using the 272 libtecla_version() function. See the libtecla(3) man page. 273 274 The new gl_group_history() function allows applications to group 275 different types of input line in the history buffer, and arrange for 276 only members of the appropriate group to be recalled on a given call 277 to gl_get_line(). See the gl_get_line(3) man page. 278 279 The new gl_show_history() function displays the current history list 280 to a given stdio output stream. See the gl_get_line(3) man page. 281 282 new_GetLine() now allows you to specify a history buffer size of 283 zero, thus requesting that no history buffer be allocated. You can 284 subsequently resize or delete the history buffer at any time, by 285 calling gl_resize_history(), limit the number of lines that are 286 allowed in the buffer by calling gl_limit_history(), clear either 287 all history lines from the history list, or just the history lines 288 that are associated with the current history group, by calling 289 gl_clear_history, and toggle the history mechanism on and off by 290 calling gl_toggle_history(). 291 292 The new gl_terminal_size() function can be used to query the 293 current terminal size. It can also be used to supply a default 294 terminal size on systems where no mechanism is available for 295 looking up the size. 296 297 The contents and configuration of the history list can now be 298 obtained by the calling application, by calling the new 299 gl_lookup_history(), gl_state_of_history(), gl_range_of_history() 300 and gl_size_of_history() functions. See the gl_get_line(3) man page. 301 302 Echoing of the input line as it is typed, can now be turned on and 303 off via the new gl_echo_mode() function. While echoing is disabled, 304 newly entered input lines are omitted from the history list. See 305 the gl_get_line(3) man page. 306 307 While the default remains to display the prompt string literally, 308 the new gl_prompt_style() function can be used to enable text 309 attribute formatting directives in prompt strings, such as 310 underlining, bold font, and highlighting directives. 311 312 Signal handling in gl_get_line() is now customizable. The default 313 signal handling behavior remains essentially the same, except that 314 the SIGTSTP, SIGTTIN and SIGTTOU are now forwarded to the 315 corresponding signal handler of the calling program, instead of 316 causing a SIGSTOP to be sent to the application. It is now possible 317 to remove signals from the list that are trapped by gl_get_line(), 318 as well as add new signals to this list. The signal and terminal 319 environments in which the signal handler of the calling program is 320 invoked, and what gl_get_line() does after the signal handler 321 returns, is now customizable on a per signal basis. You can now also 322 query the last signal that was caught by gl_get_line(). This is 323 useful when gl_get_line() aborts with errno=EINTR, and you need to 324 know which signal caused it to abort. 325 326 Key-sequences bound to action functions can now start with printable 327 characters. Previously only keysequences starting with control or 328 meta characters were permitted. 329 330 gl_get_line() is now 8-bit clean. If the calling program has 331 correctly called setlocale(LC_CTYPE,""), then the user can select an 332 alternate locale by setting the standard LC_CTYPE, LC_ALL, or LANG 333 environment variables, and international characters can then be 334 entered directly, either by using a non-US keyboard, or by using a 335 compose key on a standard US keyboard. Note that in locales in which 336 meta characters become printable, meta characters no longer match 337 M-c bindings, which then have to be entered using their escape-c 338 equivalents. Fortunately most modern terminal emulators either 339 output the escape-c version by default when the meta key is used, or 340 can be configured to do so (see the gl_get_line(3) man page), so in 341 most cases you can continue to use the meta key. 342 343 Completion callback functions can now tell gl_get_line() to return 344 the input line immediately after a successful tab completion, simply 345 by setting the last character of the optional continuation suffix to 346 a newline character (ie. in the call to cpl_add_completion()). 347 348 It is now safe to create and use multiple GetLine objects, albeit 349 still only from a single thread. In conjunction with the new 350 gl_configure_getline() function, this optionally allows multiple 351 GetLine objects with different bindings to be used to implement 352 different input modes. 353 354 The edit-mode configuration command now accepts the argument, 355 none. This tells gl_get_line() to revert to using just the native 356 line editing facilities provided by the terminal driver. This could 357 be used if the termcap or terminfo entry of the host terminal were 358 badly corrupted. 359 360 Application callback functions invoked by gl_get_line() can now 361 change the displayed prompt using the gl_replace_prompt() function. 362 363 Their is now an optional program distributed with the library. This 364 is a beta release of a program which adds tecla command-line editing 365 to virtually any third party application without the application 366 needing to be linked to the library. See the enhance(3) man page for 367 further details. Although built and installed by default, the 368 INSTALL document explains how to prevent this. 369 370 The INSTALL document now explains how you can stop the demo programs 371 from being built and installed. 372 373 NetBSD/termcap fixes. Mike MacFaden reported two problems that he 374 saw when compiling libtecla under NetBSD. Both cases were related to 375 the use of termcap. Most systems use terminfo, so this problem has 376 gone unnoticed until now, and won't have affected the grand majority 377 of users. The configure script had a bug which prevented the check 378 for CPP working properly, and getline.c wouldn't compile due to an 379 undeclared variable when USE_TERMCAP was defined. Both problems have 380 now been fixed. Note that if you successfully compiled version 381 1.3.3, this problem didn't affect you. 382 383 An unfortunate and undocumented binding of the key-sequence M-O was 384 shadowing the arrow-key bindings on systems that use ^[OA etc. I 385 have removed this binding (the documented lower case M-o binding 386 remains bound). Under the KDE konsole terminal this was causing the 387 arrow keys to do something other than expected. 388 389 There was a bug in the history list code which could result in 390 strange entries appearing at the start of the history list once 391 enough history lines had been added to the list to cause the 392 circular history buffer to wrap. This is now fixed. 393 394Version 1.3.3: 395 396 Signal handling has been re-written, and documentation of its 397 behaviour has been added to the gl_get_line(3) man page. In addition 398 to eliminating race conditions, and appropriately setting errno for 399 those signals that abort gl_get_line(), many more signals are now 400 intercepted, making it less likely that the terminal will be left in 401 raw mode by a signal that isn't trapped by gl_get_line(). 402 403 A bug was also fixed that was leaving the terminal in raw mode if 404 the editing mode was changed interactively between vi and emacs. 405 This was only noticeable when running programs from old shells that 406 don't reset terminal modes. 407 408Version 1.3.2: 409 410 Tim Eliseo contributed a number of improvements to vi mode, 411 including a fuller set of vi key-bindings, implementation of the vi 412 constraint that the cursor can't backup past the point at which 413 input mode was entered, and restoration of overwritten characters 414 when backspacing in overwrite mode. There are also now new bindings 415 to allow users to toggle between vi and emacs modes interactively. 416 The terminal bell is now used in some circumstances, such as when an 417 unrecognized key sequence is entered. This can be turned off by the 418 new nobeep option in the tecla configuration file. 419 420 Unrelated to the above, a problem under Linux which prevented ^Q 421 from being used to resume terminal output after the user had pressed 422 ^S, has been fixed. 423 424Version 1.3.1: 425 426 In vi mode a bug was preventing the history-search-backward and 427 history-search-forward actions from doing anything when invoked on 428 empty lines. On empty lines they now act like up-history and 429 down-history respectively, as in emacs mode. 430 431 When creating shared libraries under Linux, the -soname directive 432 was being used incorrectly. The result is that Linux binaries linked 433 with the 1.2.3, 1.2.4 and 1.3.0 versions of the tecla shared 434 libraries, will refuse to see other versions of the shared library 435 until relinked with version 1.3.1 or higher. 436 437 The configure script can now handle the fact that under Solaris-2.6 438 and earlier, the only curses library is a static one that hides in 439 /usr/ccs/lib. Under Linux it now also caters for old versions of GNU 440 ld which don't accept version scripts. 441 442 The demos are now linked against the shared version of the library 443 if possible. Previously they were always linked with the static 444 version. 445 446Version 1.3.0: 447 448 The major change in this release is the addition of an optional vi 449 command-line editing mode in gl_get_line(), along with lots of new 450 action functions to support its bindings. To enable this, first 451 create a ~/.teclarc file if you don't already have one, then add the 452 following line to it. 453 454 edit-mode vi 455 456 The default vi bindings, which are designed to mimic those of the vi 457 editor as closely as possible, are described in the gl_get_line(3) 458 man page. 459 460 A new convenience function called ef_list_expansions() has been 461 added for listing filename expansions. See the ef_list_expansions(3) 462 man page for details. This is used in a new list-glob binding, bound 463 to ^Xg in emacs mode, and ^G in vi input mode. 464 465 A bug has been fixed in the key-binding table expansion code. This 466 bug would have caused problems to anybody who defined more than 467 about 18 personalized key-bindings in their ~/.teclarc file. 468 469Version 1.2.4: 470 471 Buffered I/O is now used for writing to terminals, and where 472 supported, cursor motion is done with move-n-positions terminfo 473 capabilities instead of doing lots of move-1-position requests. This 474 greatly improves how the library feels over slow links. 475 476 You can now optionally compile different architectures in different 477 directories, without having to make multiple copies of the 478 distribution. This is documented in the INSTALL file. 479 480 The ksh ~+ directive is now supported. 481 482 Thanks to Markus Gyger for the above improvements. 483 484 Documentation has been added to the INSTALL file describing features 485 designed to facilitate configuration and installation of the library 486 as part of larger packages. These features are intended to remove 487 the need to modify the tecla distribution's configuration and build 488 procedures when embedding the libtecla distribution in other package 489 distributions. 490 491 A previous fix to stop the cursor from warping when the last 492 character of the input line was in the last column of the terminal, 493 was only being used for the first terminal line of the input line. 494 It is now used for all subsequent lines as well, as originally 495 intended. 496 497Version 1.2.3: 498 499 The installation procedure has been better automated with the 500 addition of an autoconf configure script. This means that installers 501 can now compile and install the library by typing: 502 503 ./configure 504 make 505 make install 506 507 On all systems this makes at least the normal static version of the 508 tecla library. It also makes the reentrant version if reentrant 509 POSIX functions are detected. Under Solaris, Linux and HP-UX the 510 configuration script arranges for shared libraries to be compiled in 511 addition to the static libraries. It is hoped that installers will 512 return information about how to compile shared libraries on other 513 systems, for inclusion in future releases, and to this end, a new 514 PORTING guide has been provided. 515 516 The versioning number scheme has been changed. This release would 517 have been 1.2c, but instead will be refered to as 1.2.3. The 518 versioning scheme, based on conventions used by Sun Microsystems, is 519 described in configure.in. 520 521 The library was also tested under HP-UX, and this revealed two 522 serious bugs, both of which have now been fixed. 523 524 The first bug prevented the library from writing control codes to 525 terminals on big-endian machines, with the exception of those 526 running under Solaris. This was due to an int variable being used 527 where a char was needed. 528 529 The second bug had the symptom that on systems that don't use the 530 newline character as the control code for moving the cursor down a 531 line, a newline wasn't started when the user hit enter. 532 533Version 1.2b: 534 535 Two more minor bug fixes: 536 537 Many terminals don't wrap the cursor to the next line when a 538 character is written to the rightmost terminal column. Instead, they 539 delay starting a new line until one more character is written, at 540 which point they move the cursor two positions. gl_get_line() 541 wasn't aware of this, so cursor repositionings just after writing 542 the last character of a column, caused it to erroneously go up a 543 line. This has now been remedied, using a method that should work 544 regardless of whether a terminal exhibits this behavior or not. 545 546 Some systems dynamically record the current terminal dimensions in 547 environment variables called LINES and COLUMNS. On such systems, 548 during the initial terminal setup, these values should override the 549 static values read from the terminal information databases, and now 550 do. Previously they were only used if the dimensions returned by 551 terminfo/termcap looked bogus. 552 553Version 1.2a: 554 555 This minor release fixes the following two bugs: 556 557 The initial terminal size and subsequent changes thereto, weren't 558 being noticed by gl_get_line(). This was because the test for the 559 existence of TIOCWINSZ was erroneously placed before the inclusion 560 of termios.h. One of the results was that on input lines that 561 spanned more than one terminal line, the cursor occasionally jumped 562 unexpectedly to the previous terminal line. 563 564 On entering a line that wrapped over multiple terminal lines, 565 gl_get_line() simply output a carriage-return line-feed at the point 566 at which the user pressed return. Thus if one typed in such a line, 567 then moved back onto one of the earlier terminal lines before 568 hitting return, the cursor was left on a line containing part of the 569 line that had just been entered. This didn't do any harm, but it 570 looked a mess. 571 572Version 1.2: 573 574 A new facility for looking up and completing filenames in UNIX-style 575 paths has now been added (eg. you can search for, or complete 576 commands using the UNIX PATH environment variable). See the 577 pca_lookup_file(3) man page. 578 579 The already existing filename completion callback can now be made 580 selective in what types of files it lists. See the 581 cpl_complete_word(3) man page. 582 583 Due to its potential to break applications when changed, the use of 584 the publically defined CplFileArgs structure to configure the 585 cpl_file_completions() callback is now deprecated. The definition 586 of this structure has been frozen, and its documentation has been 587 removed from the man pages. It will remain supported, but if you 588 have used it, you are recommended to switch to the new method, which 589 involves a new opaque configuration object, allocated via a provided 590 constructor function, configured via accessor functions, and 591 eventually deleted with a provided destructor function. The 592 cpl_file_completions() callback distinguishes which structure type 593 it has been sent by virtue of a code placed at the start of the new 594 structure by the constructor. It is assumed that no existing 595 applications set the boolean 'escaped' member of the CplFileArgs 596 structure to 4568. The new method is documented in the 597 cpl_complete_word(3) man page. 598 599Version 1.1j 600 601 This was the initial public release on freshmeat.org. 602