Ensure terminfo definition is available to child process
This commit is contained in:
parent
3bb429dfa8
commit
cca33a5550
@ -27,3 +27,5 @@ def _get_config_dir():
|
|||||||
return ans
|
return ans
|
||||||
config_dir = _get_config_dir()
|
config_dir = _get_config_dir()
|
||||||
del _get_config_dir
|
del _get_config_dir
|
||||||
|
|
||||||
|
terminfo_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'terminfo')
|
||||||
|
|||||||
@ -14,6 +14,8 @@ from functools import lru_cache
|
|||||||
|
|
||||||
from PyQt5.QtGui import QFontMetrics
|
from PyQt5.QtGui import QFontMetrics
|
||||||
|
|
||||||
|
from .constants import terminfo_dir
|
||||||
|
|
||||||
current_font_metrics = cell_width = None
|
current_font_metrics = cell_width = None
|
||||||
libc = ctypes.CDLL(None)
|
libc = ctypes.CDLL(None)
|
||||||
wcwidth_native = libc.wcwidth
|
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.close(os.open(os.ttyname(1), os.O_RDWR))
|
||||||
os.environ['TERM'] = opts.term
|
os.environ['TERM'] = opts.term
|
||||||
os.environ['COLORTERM'] = 'truecolor'
|
os.environ['COLORTERM'] = 'truecolor'
|
||||||
|
os.environ['TERMINFO'] = terminfo_dir
|
||||||
os.execvp(argv[0], argv)
|
os.execvp(argv[0], argv)
|
||||||
else:
|
else:
|
||||||
os.close(slave)
|
os.close(slave)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user