You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
edit.c: get_tput(): also deactivate DEBUG trap (re: 667034f)
Reproducer:
1. Invoke xterm (effects vary by terminal)
2. Create issue828.sh with:
trap 'printf "\033]0;%s\007" "${.sh.command}" >&2' DEBUG
3. ENV=$PWD/issue828.sh ksh
Expected behaviour: graceful init, titlebar updated before
executing each command. Actual behaviour: audible beep and messed
up terminal display on init, followed by expected behaviour.
Analysis: The get_tput command introduced in the referenced commit
invokes tput(1) to obtain escape sequences needed for multiline
editing. To avoid noise it deactivates the xtrace and verbose shell
options, but I had not thought of also deactivating the DEBUG trap.
Since this gets run after reading the ENV script, the DEBUG trap is
executed for the .sh.value assignment, which echoes those escape
sequences to the terminal.
src/cmd/ksh93/edit/edit.c: get_tput():
- Temporarily deactivate the DEBUG trap while getting the shell to
run the command substitution that invokes tput(1).
Thanks to Nick Papadonis (@nickpapadonis) for the report.
Resolves: #828
0 commit comments