Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bash/preexec): support termcap names for tput (#1670)
* fix(bash/preexec): support termcap-based tput The current uses of tput specify the terminfo entry names. However, there are different implementations of the tput command. There are two ways to specify the terminal capability: terminfo and termcap names. Although recent implementations of tput (such as ncurses in Linux) accepts the terminfo name, some accept both the terminfo and termcap names, and some old implementations (such as in FreeBSD) only accept the termcap names. In this patch, we first attempt the terminfo name and then the termcap name if the terminfo name fails. Note: When both fail due to e.g. non-existent tput, we end up with outputting nothing. This does not cause a serious problem because it just does not clear the previous prompts. * perf(bash/preexec): cache the results of tput With the current implementation, we spwan 10 processes of the tput command at most every time we perform `enter_accept`. In this patch, to reduce the delay, we separate the related code into a function and cache the results of the tput commands.
- Loading branch information