terminfo: cleaner, use %c on linux.

db4
John Benediktsson 2013-04-26 07:10:40 -07:00
parent 1d93236129
commit 4fd874bbdc
1 changed files with 7 additions and 3 deletions

View File

@ -65,9 +65,13 @@ PRIVATE>
: file>terminfo ( path -- terminfo ) : file>terminfo ( path -- terminfo )
binary [ read-terminfo ] with-file-reader ; binary [ read-terminfo ] with-file-reader ;
: terminfo-path ( name -- path ) HOOK: terminfo-path os ( name -- path )
[ first os macosx? [ >hex ] when ] keep
"/usr/share/terminfo/%s/%s" sprintf ; M: macosx terminfo-path ( name -- path )
[ first >hex ] keep "/usr/share/terminfo/%s/%s" sprintf ;
M: linux terminfo-path ( name -- path )
[ first ] keep "/usr/share/terminfo/%c/%s" sprintf ;
MEMO: terminfo-names ( -- names ) MEMO: terminfo-names ( -- names )
"/usr/share/terminfo" [ "/usr/share/terminfo" [