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)