Make terminfo data available in program

This commit is contained in:
Kovid Goyal
2016-11-24 11:29:28 +05:30
parent d65caa767a
commit 8610bffb40
4 changed files with 360 additions and 47 deletions

View File

@@ -1,7 +1,16 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import sys
base = os.path.dirname(os.path.abspath(__file__))
os.chdir(base)
sys.path.insert(0, base)
from kitty.terminfo import generate_terminfo # noqa
with open('terminfo/kitty.terminfo', 'w') as f:
f.write(generate_terminfo())
os.environ['TERMINFO'] = os.path.join(base, 'terminfo')
os.execvp('tic', 'tic terminfo/kitty.terminfo'.split())