1
0
mirror of https://github.com/gdamore/tcell.git synced 2025-04-24 13:48:51 +08:00

fixes #167 Break up the database

This completely restructures the database of terminal types, putting
each terminal in its own file.  We also compress the database files,
and use infocmp instead of trying to use the C level API.

The mkdatabase script will rebuild the entire database from the terminfo
files on the system.  Individual entries can also be built by simply running
the mkinfo program with the terminal type.
This commit is contained in:
Garrett D'Amore 2017-11-23 12:31:44 -08:00
parent 87c64c441a
commit 8f08469772
2350 changed files with 4987 additions and 3948 deletions

View File

@ -1,3 +1,4 @@
Garrett D'Amore <garrett@damore.org> Garrett D'Amore <garrett@damore.org>
Zachary Yedidia <zyedidia@gmail.com> Zachary Yedidia <zyedidia@gmail.com>
Junegunn Choi <junegunn.c@gmail.com> Junegunn Choi <junegunn.c@gmail.com>
Staysail Systems, Inc. <info@staysail.tech>

View File

@ -1,15 +0,0 @@
d200-dg=d200
d214=d210
Eterm-color=Eterm
X-hpterm=hpterm
sun1=sun
sun2=sun
tvi914=tvi912
tvi920=tvi912
vt100-am=vt100
vt200=vt220
vt300=vt320
vt400-24=vt400
dec-vt400=vt400
wyse50=wy50
wyse60=wy60

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,8 @@ package tcell
import ( import (
"errors" "errors"
"time" "time"
"github.com/gdamore/tcell/terminfo"
) )
var ( var (
@ -27,7 +29,7 @@ var (
// is required. For example, legacy "adm3" lacks this capability, // is required. For example, legacy "adm3" lacks this capability,
// whereas the slightly newer "adm3a" supports it. This failure // whereas the slightly newer "adm3a" supports it. This failure
// occurs most often with "dumb". // occurs most often with "dumb".
ErrTermNotFound = errors.New("terminal entry not found") ErrTermNotFound = terminfo.ErrTermNotFound
// ErrNoScreen indicates that no suitable screen could be found. // ErrNoScreen indicates that no suitable screen could be found.
// This may result from attempting to run on a platform where there // This may result from attempting to run on a platform where there

View File

@ -1,50 +0,0 @@
#!/bin/sh
# Copyright 2015 The TCell Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use file except in compliance with the License.
# You may obtain a copy of the license at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This shell script builds the Go database, which is somewhat minimal for
# size reasons (it only contains the most commonly used entries), and
# then builds the complete JSON database.
#
terms=/tmp/terms.$$
# This script is not very efficient, but there isn't really a better way without
# writing code to decode the terminfo binary format directly. Its not worth
# worrying about.
# now get the rest
all=`toe -a | cut -f1`
echo Scanning terminal definitions
echo > $terms
for f in $all; do
infocmp $f | awk -v FS="|" -v OFS=" " '/^[^# ]/ { print $1; for (i = 2; i < NF; i++) print $i "=" $1; }' |sort >> $terms
printf "."
done
echo
# make sure we have mkinfo
echo "Building mkinfo"
go build mkinfo.go
# first make the database.go file
echo "Building Go database"
./mkinfo -go database.go `cat models.txt aliases.txt`
go fmt database.go
echo "Building JSON database"
./mkinfo -nofatal -quiet -json database.json `cat $terms`

1
terminfo/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
mkinfo

1
terminfo/database/1/1178 Normal file
View File

@ -0,0 +1 @@
{"name":"adm1178"}

1
terminfo/database/2/2621 Normal file
View File

@ -0,0 +1 @@
{"name":"hp2621"}

View File

@ -0,0 +1 @@
{"name":"hp2621"}

View File

@ -0,0 +1 @@
{"name":"hp2621"}

View File

@ -0,0 +1 @@
{"name":"att6386"}

1
terminfo/database/3/3b1 Normal file
View File

@ -0,0 +1 @@
{"name":"att7300"}

View File

@ -0,0 +1 @@
{"name":"att5410-w"}

View File

@ -0,0 +1 @@
{"name":"att5410-w"}

1
terminfo/database/5/5620 Normal file
View File

@ -0,0 +1 @@
{"name":"att5620"}

View File

@ -0,0 +1 @@
{"name":"att630-24"}

View File

@ -0,0 +1 @@
{"name":"att630-24"}

1
terminfo/database/6/6053 Normal file
View File

@ -0,0 +1 @@
{"name":"dg6053"}

View File

@ -0,0 +1 @@
{"name":"dg6053"}

1
terminfo/database/6/605x Normal file
View File

@ -0,0 +1 @@
{"name":"dg6053"}

View File

@ -0,0 +1 @@
{"name":"dg6053"}

View File

@ -0,0 +1 @@
{"name":"att630-24"}

View File

@ -0,0 +1 @@
{"name":"att730-24"}

View File

@ -0,0 +1 @@
{"name":"att730-41"}

View File

@ -0,0 +1 @@
{"name":"att730r-41"}

View File

@ -0,0 +1 @@
{"name":"att730r"}

View File

@ -0,0 +1 @@
{"name":"att730r-24"}

View File

@ -0,0 +1 @@
{"name":"tvi955-hb"}

View File

@ -0,0 +1 @@
{"name":"tvi955-w"}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
{"name":"Eterm"}

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
terminfo/database/E/elks.gz Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
{"name":"gs6300"}

Binary file not shown.

BIN
terminfo/database/E/emu.gz Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
{"name":"env230"}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
{"name":"excel62"}

View File

@ -0,0 +1 @@
{"name":"excel62-rv"}

View File

@ -0,0 +1 @@
{"name":"excel62-w"}

View File

@ -0,0 +1 @@
{"name":"hazel"}

Binary file not shown.

Binary file not shown.

BIN
terminfo/database/M/mac.gz Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
terminfo/database/M/mach.gz Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
{"name":"mac"}

View File

@ -0,0 +1 @@
{"name":"mac-w"}

BIN
terminfo/database/M/mai.gz Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
{"name":"cyb110"}

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
terminfo/database/M/mgr.gz Normal file

Binary file not shown.

BIN
terminfo/database/M/mgt.gz Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
{"name":"microb"}

View File

@ -0,0 +1 @@
{"name":"act4"}

View File

@ -0,0 +1 @@
{"name":"act5"}

View File

@ -0,0 +1 @@
{"name":"mime3ax"}

Binary file not shown.

Binary file not shown.

BIN
terminfo/database/M/mime.gz Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
{"name":"mime"}

View File

@ -0,0 +1 @@
{"name":"mime"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"name":"mime2a"}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
{"name":"mm340"}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
{"name":"mime"}

View File

@ -0,0 +1 @@
{"name":"mime"}

View File

@ -0,0 +1 @@
{"name":"m2-nam"}

View File

@ -0,0 +1 @@
{"name":"m2-nam"}

View File

@ -0,0 +1 @@
{"name":"m2-nam"}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More