diff options
| author | Koichi Murase <myoga.murase@gmail.com> | 2024-02-05 02:36:06 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-04 17:36:06 +0000 |
| commit | c2af6f7ae890333d6f367e863d77d3dfe9b36f8a (patch) | |
| tree | c52f7b31f6a45aa517ceff6f31c933e60fc0c202 /atuin-client/src | |
| parent | fix(bash/preexec): erase the previous prompt before overwriting (diff) | |
| download | atuin-c2af6f7ae890333d6f367e863d77d3dfe9b36f8a.zip | |
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.
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
