tput ed的输出是空的,我不知道为什么。其他功能可以正常工作。另外,ed在infocmp输出中没有丢失,所以tput应该匹配,对吗?
$ printf '%q' "$(tput ed)"
''$ printf '%q' "$(tput home)"
我在MacOS10.14.6和iTerm2上使用zsh。术语=x项-256色。\033'\[H我在MacOS10.14.6和iTerm2上使用zsh。术语=x项-256色。
发布于 2019-11-19 05:20:10
在对文档进行了更多的搜索和浏览(主要是终版)之后,我终于意识到,我需要回到以前的术语代码中,因为capname并不是所有终端功能都支持的。
ed=$(tput ed || tput cd)发布于 2019-12-08 02:10:45
Apple配置了具有术语上限支持的ncurses (除了默认的终端):
_nc_read_entry,后者调用_nc_read_tic_entry,后者调用_nc_read_file_entry_nc_read_tic_entry中存在问题,那么_nc_read_entry将回到术语上限支持(参见read_entry.c)。因为这是10年前的代码,_nc_read_tic_entry中可能出现的问题可能已经修复了一段时间。
例如,我已经安装了MacPorts,这是正常工作的,而苹果的版本却没有。下面是我用来调查问题的顶级脚本:
#!/bin/sh
unset TERMINFO
unset TERMINFO_DIRS
export TERM=xterm-256color
#export PATH=/usr/bin:$PATH
echo TERMCAP
infocmp -CrTt1 | grep -E ':..=.*:' | sed -e 's/^ ://' -e 's/=.*//' | xargs -n 1 /tmp/test-tput
echo TERMINFO
infocmp -1 | grep -E '^ .*=.*,' | sed -e 's/^ //' -e 's/=.*//' | xargs -n 1 /tmp/test-tput(注释/取消注释PATH以在两者之间进行选择),并调用第二个脚本/tmp/test-tput来显示值:
#!/bin/bash
tput "$1" >/dev/null 2>/dev/null || exit
echo -n "CAP:$1 "
tput "$1" 2>/dev/null
echoNcures5.7中的行为是在1999年年中引入的一个bug
+ modify tput to accept termcap names as an alternative to terminfo
names (patch by Jeffrey C Honig).并在2009年年中固定:
+ change order of lookup in progs/tput.c, looking for terminfo data
first. This fixes a confusion between termcap "sg" and terminfo
"sgr" or "sgr0", originally from 990123 changes, but exposed by
20091114 fixes for hashing. With this change, only "dl" and "ed" are
ambiguous (Mandriva #56272).苹果的ncurses 5.7比这个版本早了大约一年。
https://unix.stackexchange.com/questions/552845
复制相似问题