2016-10-03 122 views
2

我試圖在macOS上使用ncurses 6.0。我已經下載了該項目並使用提供的makefile創建了C++演示。然而,當我運行演示,我得到的錯誤:MacOS上的ncurses(OSX)找不到xterm-256color

Error opening terminal: xterm-256color.

這可能與我沒有一個x文件夾在我的terminfo目錄:

$ ls /usr/share/terminfo/ 
31 36 45 51 64 69 6e 73 78 
32 37 4c 58 65 6a 6f 74 7a 
33 38 4d 61 66 6b 70 75 
34 39 4e 62 67 6c 71 76 
35 41 50 63 68 6d 72 77 

演示工作正常在Debian 。


我配置的輸出是:

** Configuration summary for NCURSES 6.0 20150808: 

     extended funcs: yes 
     xterm terminfo: xterm-new 

     bin directory: /usr/local/bin 
     lib directory: /usr/local/lib 
    include directory: /usr/local/include/ncurses 
     man directory: /usr/local/share/man 
    terminfo directory: /usr/local/share/terminfo 

** Include-directory is not in a standard location 

因爲我懶,不看手冊我沒有運行完整的安裝過程。運行後:

./configure 
make 
make install 

它現在的作品。

+0

嘗試從'test'目錄中執行'./configure && make' ... –

+0

@我'我'這似乎工作,但我在找什麼? – sdgfsdh

+1

我不確定你在找什麼,雖然你明顯通過make install來找到它。 :) –

回答

2

當您構建ncurses時,configure腳本會在最後告訴您安裝的位置。如果你給在OSX任何選項,它看起來就像這樣:

creating headers.sh 

** Configuration summary for NCURSES 6.0 20160409: 

     extended funcs: yes 
     xterm terminfo: xterm-new 

     bin directory: /usr/local/bin 
     lib directory: /usr/local/lib 
    include directory: /usr/local/include/ncurses 
     man directory: /usr/local/share/man 
    terminfo directory: /usr/local/share/terminfo 

** Include-directory is not in a standard location 

您可以覆蓋的terminfo目錄的位置(讀取INSTALL文件),或通過設置在運行時告訴庫中TERMINFO和/或TERMINFO_DIRS環境變量。但是如果沒有做這些事情之一,它會在不同的位置查找終端數據庫。

ncurses configure腳本爲某些系統(主要是基於Linux)提供了一個--prefix=/usr選項,因爲它預計是系統curses庫(再次閱讀INSTALL)。 OSX在這裏並不奇怪。

OSX與通常情況不同:它的文件系統(通常)忽略大寫/小寫名稱之間的區別。配置腳本檢查這個,如果是的話,它會在一個解決方法中編譯,將這些單個字母編碼爲十六進制數字。例如,0x78是「x」。