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:
parent
87c64c441a
commit
8f08469772
1
AUTHORS
1
AUTHORS
@ -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>
|
||||||
|
15
aliases.txt
15
aliases.txt
@ -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
|
|
3588
database.go
3588
database.go
File diff suppressed because it is too large
Load Diff
@ -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
|
||||||
|
@ -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
1
terminfo/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
mkinfo
|
1
terminfo/database/1/1178
Normal file
1
terminfo/database/1/1178
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"adm1178"}
|
1
terminfo/database/2/2621
Normal file
1
terminfo/database/2/2621
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"hp2621"}
|
1
terminfo/database/2/2621-wl
Normal file
1
terminfo/database/2/2621-wl
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"hp2621"}
|
1
terminfo/database/2/2621a
Normal file
1
terminfo/database/2/2621a
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"hp2621"}
|
1
terminfo/database/3/386at
Normal file
1
terminfo/database/3/386at
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att6386"}
|
1
terminfo/database/3/3b1
Normal file
1
terminfo/database/3/3b1
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att7300"}
|
1
terminfo/database/4/4410-w
Normal file
1
terminfo/database/4/4410-w
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att5410-w"}
|
1
terminfo/database/5/5410-w
Normal file
1
terminfo/database/5/5410-w
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att5410-w"}
|
1
terminfo/database/5/5620
Normal file
1
terminfo/database/5/5620
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att5620"}
|
1
terminfo/database/5/5630-24
Normal file
1
terminfo/database/5/5630-24
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att630-24"}
|
1
terminfo/database/5/5630DMD-24
Normal file
1
terminfo/database/5/5630DMD-24
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att630-24"}
|
1
terminfo/database/6/6053
Normal file
1
terminfo/database/6/6053
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"dg6053"}
|
1
terminfo/database/6/6053-dg
Normal file
1
terminfo/database/6/6053-dg
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"dg6053"}
|
1
terminfo/database/6/605x
Normal file
1
terminfo/database/6/605x
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"dg6053"}
|
1
terminfo/database/6/605x-dg
Normal file
1
terminfo/database/6/605x-dg
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"dg6053"}
|
1
terminfo/database/6/630MTG-24
Normal file
1
terminfo/database/6/630MTG-24
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att630-24"}
|
1
terminfo/database/7/730MTG-24
Normal file
1
terminfo/database/7/730MTG-24
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att730-24"}
|
1
terminfo/database/7/730MTG-41
Normal file
1
terminfo/database/7/730MTG-41
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att730-41"}
|
1
terminfo/database/7/730MTG-41r
Normal file
1
terminfo/database/7/730MTG-41r
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att730r-41"}
|
1
terminfo/database/7/730MTGr
Normal file
1
terminfo/database/7/730MTGr
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att730r"}
|
1
terminfo/database/7/730MTGr-24
Normal file
1
terminfo/database/7/730MTGr-24
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"att730r-24"}
|
1
terminfo/database/9/955-hb
Normal file
1
terminfo/database/9/955-hb
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"tvi955-hb"}
|
1
terminfo/database/9/955-w
Normal file
1
terminfo/database/9/955-w
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"tvi955-w"}
|
BIN
terminfo/database/E/Eterm-256color.gz
Normal file
BIN
terminfo/database/E/Eterm-256color.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/Eterm-88color.gz
Normal file
BIN
terminfo/database/E/Eterm-88color.gz
Normal file
Binary file not shown.
1
terminfo/database/E/Eterm-color
Normal file
1
terminfo/database/E/Eterm-color
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"Eterm"}
|
BIN
terminfo/database/E/Eterm.gz
Normal file
BIN
terminfo/database/E/Eterm.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/elks-ansi.gz
Normal file
BIN
terminfo/database/E/elks-ansi.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/elks-vt52.gz
Normal file
BIN
terminfo/database/E/elks-vt52.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/elks.gz
Normal file
BIN
terminfo/database/E/elks.gz
Normal file
Binary file not shown.
1
terminfo/database/E/emots
Normal file
1
terminfo/database/E/emots
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"gs6300"}
|
BIN
terminfo/database/E/emu-220.gz
Normal file
BIN
terminfo/database/E/emu-220.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/emu.gz
Normal file
BIN
terminfo/database/E/emu.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/emx-base.gz
Normal file
BIN
terminfo/database/E/emx-base.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/env230.gz
Normal file
BIN
terminfo/database/E/env230.gz
Normal file
Binary file not shown.
1
terminfo/database/E/envision230
Normal file
1
terminfo/database/E/envision230
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"env230"}
|
BIN
terminfo/database/E/ergo4000.gz
Normal file
BIN
terminfo/database/E/ergo4000.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/esprit-am.gz
Normal file
BIN
terminfo/database/E/esprit-am.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/esprit.gz
Normal file
BIN
terminfo/database/E/esprit.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/ex155.gz
Normal file
BIN
terminfo/database/E/ex155.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/excel62-rv.gz
Normal file
BIN
terminfo/database/E/excel62-rv.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/excel62-w.gz
Normal file
BIN
terminfo/database/E/excel62-w.gz
Normal file
Binary file not shown.
BIN
terminfo/database/E/excel62.gz
Normal file
BIN
terminfo/database/E/excel62.gz
Normal file
Binary file not shown.
1
terminfo/database/E/excel64
Normal file
1
terminfo/database/E/excel64
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"excel62"}
|
1
terminfo/database/E/excel64-rv
Normal file
1
terminfo/database/E/excel64-rv
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"excel62-rv"}
|
1
terminfo/database/E/excel64-w
Normal file
1
terminfo/database/E/excel64-w
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"excel62-w"}
|
1
terminfo/database/E/exec80
Normal file
1
terminfo/database/E/exec80
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"hazel"}
|
BIN
terminfo/database/M/m2-nam.gz
Normal file
BIN
terminfo/database/M/m2-nam.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mac-w.gz
Normal file
BIN
terminfo/database/M/mac-w.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mac.gz
Normal file
BIN
terminfo/database/M/mac.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mach-bold.gz
Normal file
BIN
terminfo/database/M/mach-bold.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mach-color.gz
Normal file
BIN
terminfo/database/M/mach-color.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mach.gz
Normal file
BIN
terminfo/database/M/mach.gz
Normal file
Binary file not shown.
1
terminfo/database/M/macintosh
Normal file
1
terminfo/database/M/macintosh
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"mac"}
|
1
terminfo/database/M/macterminal-w
Normal file
1
terminfo/database/M/macterminal-w
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"mac-w"}
|
BIN
terminfo/database/M/mai.gz
Normal file
BIN
terminfo/database/M/mai.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/masscomp.gz
Normal file
BIN
terminfo/database/M/masscomp.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/masscomp1.gz
Normal file
BIN
terminfo/database/M/masscomp1.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/masscomp2.gz
Normal file
BIN
terminfo/database/M/masscomp2.gz
Normal file
Binary file not shown.
1
terminfo/database/M/mdl110
Normal file
1
terminfo/database/M/mdl110
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"cyb110"}
|
BIN
terminfo/database/M/memhp.gz
Normal file
BIN
terminfo/database/M/memhp.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mgr-linux.gz
Normal file
BIN
terminfo/database/M/mgr-linux.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mgr-sun.gz
Normal file
BIN
terminfo/database/M/mgr-sun.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mgr.gz
Normal file
BIN
terminfo/database/M/mgr.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mgt.gz
Normal file
BIN
terminfo/database/M/mgt.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mgterm.gz
Normal file
BIN
terminfo/database/M/mgterm.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/microb.gz
Normal file
BIN
terminfo/database/M/microb.gz
Normal file
Binary file not shown.
1
terminfo/database/M/microbee
Normal file
1
terminfo/database/M/microbee
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"microb"}
|
1
terminfo/database/M/microterm
Normal file
1
terminfo/database/M/microterm
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"act4"}
|
1
terminfo/database/M/microterm5
Normal file
1
terminfo/database/M/microterm5
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"act5"}
|
1
terminfo/database/M/mime-3ax
Normal file
1
terminfo/database/M/mime-3ax
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"mime3ax"}
|
BIN
terminfo/database/M/mime-fb.gz
Normal file
BIN
terminfo/database/M/mime-fb.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mime-hb.gz
Normal file
BIN
terminfo/database/M/mime-hb.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mime.gz
Normal file
BIN
terminfo/database/M/mime.gz
Normal file
Binary file not shown.
1
terminfo/database/M/mime1
Normal file
1
terminfo/database/M/mime1
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"mime"}
|
1
terminfo/database/M/mime2
Normal file
1
terminfo/database/M/mime2
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"mime"}
|
BIN
terminfo/database/M/mime2a-s.gz
Normal file
BIN
terminfo/database/M/mime2a-s.gz
Normal file
Binary file not shown.
1
terminfo/database/M/mime2a-v
Normal file
1
terminfo/database/M/mime2a-v
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"mime2a"}
|
BIN
terminfo/database/M/mime2a.gz
Normal file
BIN
terminfo/database/M/mime2a.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mime314.gz
Normal file
BIN
terminfo/database/M/mime314.gz
Normal file
Binary file not shown.
1
terminfo/database/M/mime340
Normal file
1
terminfo/database/M/mime340
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"mm340"}
|
BIN
terminfo/database/M/mime3a.gz
Normal file
BIN
terminfo/database/M/mime3a.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/mime3ax.gz
Normal file
BIN
terminfo/database/M/mime3ax.gz
Normal file
Binary file not shown.
1
terminfo/database/M/mimei
Normal file
1
terminfo/database/M/mimei
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"mime"}
|
1
terminfo/database/M/mimeii
Normal file
1
terminfo/database/M/mimeii
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"mime"}
|
1
terminfo/database/M/minitel
Normal file
1
terminfo/database/M/minitel
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"m2-nam"}
|
1
terminfo/database/M/minitel-2
Normal file
1
terminfo/database/M/minitel-2
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"m2-nam"}
|
1
terminfo/database/M/minitel-2-nam
Normal file
1
terminfo/database/M/minitel-2-nam
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"m2-nam"}
|
BIN
terminfo/database/M/minitel1.gz
Normal file
BIN
terminfo/database/M/minitel1.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/minitel1b-80.gz
Normal file
BIN
terminfo/database/M/minitel1b-80.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/minitel1b.gz
Normal file
BIN
terminfo/database/M/minitel1b.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/minix-old-am.gz
Normal file
BIN
terminfo/database/M/minix-old-am.gz
Normal file
Binary file not shown.
BIN
terminfo/database/M/minix-old.gz
Normal file
BIN
terminfo/database/M/minix-old.gz
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user