mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
{edit,fault}.c: improve SIGWINCH and SIGINT handling
The fault.c and edit.c changes in this commit were inspired by changes in the 93v- beta but take a slightly different approach: mainly, the code to update $COLUMNS and $LINES is put in its own function instead of duplicated in sh_chktrap() and ed_setup(). src/cmd/ksh93/sh/fault.c: - Move code to update $COLUMNS and $LINES to a new sh_update_columns_lines() function so it can be reused. - Fix compile error on systems without SIGWINCH. src/cmd/ksh93/edit/edit.c: - ed_setup(): Call sh_update_columns_lines() instead of issuing SIGWINCH to self. - Change two sh_fault(SIGINT) calls to issuing the signal to the current process using kill(2). sh_fault() is now never called directly (as in the 93v- beta). src/cmd/ksh93/sh/main.c: sh_main(): - On non-interactive, call sh_update_columns_lines() and set the signal handler for SIGWINCH to sh_fault(), causing $COLUMNS and $LINES to be kept up to date when the terminal window is resized (this is handled elsewhere for interactive shells). This change makes ksh act like mksh, bash and zsh. (Previously, ksh required setting a dummy SIGWINCH trap to get auto-updated $COLUMNS and $LINES in scripts, as this set the SIGWINCH signal handler to sh_fault(). This persisted even after unsetting the trap again, so that was inconsistent behaviour.) src/cmd/ksh93/include/shell.h: - Don't define sh.winch on systems without SIGWINCH. src/cmd/ksh93/sh.1: - Update and tweak the COLUMNS and LINES variable documentation. - Move them up to the section of variables that are set by the shell (which AT&T should have done before).
This commit is contained in:
parent
416a412d71
commit
372d704bfb
8 changed files with 70 additions and 42 deletions
6
NEWS
6
NEWS
|
@ -3,6 +3,12 @@ For full details, see the git log at: https://github.com/ksh93/ksh/tree/1.0
|
|||
|
||||
Any uppercase BUG_* names are modernish shell bug IDs.
|
||||
|
||||
2022-07-01:
|
||||
|
||||
- In scripts, $COLUMNS and $LINES are now kept up to date in scripts at
|
||||
initialization and when the window size changes (previously, this
|
||||
required setting a dummy trap for the SIGWINCH signal in the script).
|
||||
|
||||
2022-06-28:
|
||||
|
||||
- Fixed a bug that caused the <#((num)) or >#((num)) arithmetic seek
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue