From 3cbb0b22dcefceab289402b168a5315e2a834078 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 23 Jan 2017 08:56:52 +0530 Subject: [PATCH] Fix terminfo file not being used on OS X On OS X tic has a different directory layout than on linux. Sigh. --- build-terminfo | 10 +++++++++- setup.py | 7 ++++--- terminfo/78/xterm-kitty | Bin 0 -> 1757 bytes 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 terminfo/78/xterm-kitty diff --git a/build-terminfo b/build-terminfo index 8805803c3..db13fae8c 100755 --- a/build-terminfo +++ b/build-terminfo @@ -2,6 +2,8 @@ import os import sys +import shutil +import subprocess base = os.path.dirname(os.path.abspath(__file__)) os.chdir(base) @@ -13,4 +15,10 @@ 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()) +subprocess.check_call(['tic', 'terminfo/kitty.terminfo']) +# On OS X tic puts the compiled database into a different directory +try: + os.mkdir('terminfo/78') +except FileExistsError: + pass +shutil.copy2('terminfo/x/xterm-kitty', 'terminfo/78') diff --git a/setup.py b/setup.py index 7a31049fd..ceb63db51 100755 --- a/setup.py +++ b/setup.py @@ -217,15 +217,16 @@ def safe_makedirs(path): def package(args): # {{{ ddir = args.prefix libdir = os.path.join(ddir, 'lib', 'kitty') - terminfo_dir = os.path.join(ddir, 'share/terminfo/x') + terminfo_sdir = ('78' if isosx else 'x') + terminfo_dir = os.path.join(ddir, 'share/terminfo/' + terminfo_sdir) if os.path.exists(libdir): shutil.rmtree(libdir) - os.makedirs(os.path.join(libdir, 'terminfo/x')) + os.makedirs(os.path.join(libdir, 'terminfo/' + terminfo_sdir)) os.makedirs(os.path.join(libdir, 'logo')) safe_makedirs(terminfo_dir) shutil.copy2('__main__.py', libdir) shutil.copy2('terminfo/x/xterm-kitty', terminfo_dir) - shutil.copy2('terminfo/x/xterm-kitty', os.path.join(libdir, 'terminfo/x')) + shutil.copy2('terminfo/x/xterm-kitty', os.path.join(libdir, 'terminfo/' + terminfo_sdir)) shutil.copy2('logo/kitty.rgba', os.path.join(libdir, 'logo')) def src_ignore(parent, entries): diff --git a/terminfo/78/xterm-kitty b/terminfo/78/xterm-kitty new file mode 100644 index 0000000000000000000000000000000000000000..4ca761612812587184f030fc226bf60610ef984e GIT binary patch literal 1757 zcmcIk-)mEM6hG&7s2dyeVS?@sLFl)Pwn^{(=B7!!vTSp>s4ekF!Roc3E@_)KZDYLl zR}$^RCTuVUvWJ2AB7#1+4H*m+*~<_?L?3+e$-hB-7<*avIp3SaZf!RhEcATN=X}2B ze1Dvi^j+RY@6p>-;vc&f!(w$NHeCwCrTW3S`Td2Fk>f;c{)pitfR99`L$rmqQ*)gU zaq}Y4YqSX&J7_2MP%p)inV|zTgt}wk$7vimMYFU>by@+x1pA7<0e(kUfz9SMxsVIM`Jualx2f(?^Brv1%izwaP& zXH0_QWn^7TfHuk6WM`9;-FsZe8TbHq!Od`3Fhm!D zi3?=su}5BRqFsp&!;Zj?LUEH&0ykwaZ7?IK9bi5uOvoo7gQ81%UY_at8ZXVuYt2<< zdqalX1cye-hixJUnw+6Fk$sIKTN*ObCfNBiveObqGb@mtlKu~q%Bo66h3Ka$qB+X9 z14pz$75c97g=$bQqOPhWR2^|DiapR|L{p$?<)gPbdfiM({z+0_Uw?lr7LPm5sZ*y< zkB?7GOiq?cQ&ZE^OcwR-Mc7@j{rKfkcBxVW^myj-i*>y5?*>C*{V zHYIb-rZBAhK5T26wl8whS+r2z4=1nJGO0j&g06fK6B*yj;A&&8<6)j-o^KlDS0~Qw zmIu~!GTBhQs)o5c4K<*2T#pXOV>epy)?cwt%4zZi(+151(L-0&(hapog$Z-8DjLZh kG+L&;9#aKXOr-r}bUo9}Kt|9h_tq(Qopyq$_x@7