From 68e00bc8e1ee563b36a1a52b835b070f8e81b38e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 14 Jan 2020 18:46:08 +0530 Subject: [PATCH] Proper fix for #2270 Fixes #2270 --- docs/changelog.rst | 2 ++ kitty/glfw.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index fc9b4238b..3ecf13610 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -16,6 +16,8 @@ To update |kitty|, :doc:`follow the instructions `. - Add a :opt:`resize_in_steps` option that can be used to resize the OS window in steps as large as character cells (:pull:`2131`) +- Fix a segfault when using :opt:`--debug-config` with maps (:iss:`2270`) + 0.15.1 [2019-12-21] -------------------- diff --git a/kitty/glfw.c b/kitty/glfw.c index 3ff8ce5ee..26f6373bd 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -840,6 +840,9 @@ static PyObject* glfw_get_key_name(PyObject UNUSED *self, PyObject *args) { int key, native_key; if (!PyArg_ParseTuple(args, "ii", &key, &native_key)) return NULL; + if (!glfwGetKeyName) { + return PyUnicode_FromFormat("key: %d native_key: %d", key, native_key); + } return Py_BuildValue("z", glfwGetKeyName(key, native_key)); }