From 0e4b8465906df136a8a2eb5b7139552d87c0b824 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 3 Nov 2016 19:28:57 +0530 Subject: [PATCH] Show a nice error message when execing() the child fails --- kitty/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kitty/utils.py b/kitty/utils.py index e707d6d2b..bc12f0de9 100644 --- a/kitty/utils.py +++ b/kitty/utils.py @@ -68,7 +68,12 @@ def fork_child(argv, cwd, opts): os.environ['COLORTERM'] = 'truecolor' if os.path.isdir(terminfo_dir): os.environ['TERMINFO'] = terminfo_dir - os.execvp(argv[0], argv) + try: + os.execvp(argv[0], argv) + except Exception as err: + print('Could not launch:', argv[0]) + print('\t', err) + input('\nPress Enter to exit:') else: os.close(slave) fork_child.pid = pid