入力エッジが空です

入力エッジが空です

出力がtput ed空で理由を理解できません。他の機能はうまく機能します。出力にも欠けていedないので、infocmptputが一致する必要があります。そうですか?

$ printf '%q' "$(tput ed)"
''
$ printf '%q' "$(tput home)"
$'\033'\[H

私はMac OS 10.14.6とiTerm2でzshを使用しています。用語=xterm-256color。

ベストアンサー1

Appleはncursesのtermcapサポートを設定します(デフォルトのterminfoに加えて):

  • 構成状態構成オプションを示すファイルです。
  • infocmp 呼び出し_nc_read_file_entryデータを取得するには。
  • 電話をかけて設定項目、これは次に進みます。_nc_read_entry、これは呼び出されます。_nc_read_tic_entry、これは実際に呼び出されます。_nc_read_file_entry
  • 問題がある場合_nc_read_tic_entry、その後_nc_read_entrytermcapサポートに置き換え(参照)read_entry.c)。

10年前のコードなので、_nc_read_tic_entryで発生する可能性のある問題はしばらく前に修正された可能性があります。

たとえば、MacPortsをインストールしましたが、正常に動作しますが、Appleのバージョンはそうではありません。問題を調査するために使用した最上位スクリプトは次のとおりです。

#!/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(2つのうちの1つを選択するにはコメント/コメント解除)これを2番目のスクリプトと呼びます。/tmp/test-tput表示値:

#!/bin/bash
tput "$1" >/dev/null 2>/dev/null || exit
echo -n "CAP:$1 "
tput "$1" 2>/dev/null
echo

ncurses 5.7の動作は次のとおりです。1999年

    + 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その修正より約1年先です。

おすすめ記事