From cca33a555040cd93aa52d9b0d0b529836a4db3d7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 17 Oct 2016 23:12:29 +0530 Subject: [PATCH] Ensure terminfo definition is available to child process --- kitty/constants.py | 2 ++ kitty/utils.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/kitty/constants.py b/kitty/constants.py index f68d54be9..3d7a85c58 100644 --- a/kitty/constants.py +++ b/kitty/constants.py @@ -27,3 +27,5 @@ def _get_config_dir(): return ans config_dir = _get_config_dir() del _get_config_dir + +terminfo_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'terminfo') diff --git a/kitty/utils.py b/kitty/utils.py index 4aaa3fea5..5247faa8b 100644 --- a/kitty/utils.py +++ b/kitty/utils.py @@ -14,6 +14,8 @@ from functools import lru_cache from PyQt5.QtGui import QFontMetrics +from .constants import terminfo_dir + current_font_metrics = cell_width = None libc = ctypes.CDLL(None) wcwidth_native = libc.wcwidth @@ -64,6 +66,7 @@ def fork_child(cmd, cwd, opts): os.close(os.open(os.ttyname(1), os.O_RDWR)) os.environ['TERM'] = opts.term os.environ['COLORTERM'] = 'truecolor' + os.environ['TERMINFO'] = terminfo_dir os.execvp(argv[0], argv) else: os.close(slave)