mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-08 21:25:32 +02:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e7b957cc7 | ||
|
|
b1424cc4c7 | ||
|
|
be7d0e2016 | ||
|
|
7e8d509fdd | ||
|
|
8672a29503 |
@@ -4,11 +4,13 @@ Changelog
|
|||||||
kitty is a feature full, cross-platform, *fast*, OpenGL based terminal emulator.
|
kitty is a feature full, cross-platform, *fast*, OpenGL based terminal emulator.
|
||||||
|
|
||||||
|
|
||||||
version 0.4.1 [2017-10-23]
|
version 0.4.2 [2017-10-23]
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
- Fix a regression in 0.4.0 that broke custom key mappings
|
- Fix a regression in 0.4.0 that broke custom key mappings
|
||||||
|
|
||||||
|
- Fix a regression in 0.4.0 that broke support for non-QWERTY keyboard layouts
|
||||||
|
|
||||||
- Avoid using threads to reap zombie child processes. Also prevent kitty from
|
- Avoid using threads to reap zombie child processes. Also prevent kitty from
|
||||||
hanging if the open program hangs when clicking on a URL.
|
hanging if the open program hangs when clicking on a URL.
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from collections import namedtuple
|
|||||||
from .fast_data_types import set_boss as set_c_boss
|
from .fast_data_types import set_boss as set_c_boss
|
||||||
|
|
||||||
appname = 'kitty'
|
appname = 'kitty'
|
||||||
version = (0, 4, 1)
|
version = (0, 4, 2)
|
||||||
str_version = '.'.join(map(str, version))
|
str_version = '.'.join(map(str, version))
|
||||||
_plat = sys.platform.lower()
|
_plat = sys.platform.lower()
|
||||||
isosx = 'darwin' in _plat
|
isosx = 'darwin' in _plat
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
#include "modes.h"
|
#include "modes.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#ifdef WITH_PROFILER
|
#ifdef WITH_PROFILER
|
||||||
#include <gperftools/profiler.h>
|
#include <gperftools/profiler.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -81,6 +83,28 @@ pyset_iutf8(PyObject UNUSED *self, PyObject *args) {
|
|||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
handle_sigchld(int UNUSED signum, siginfo_t *sinfo, void UNUSED *unused) {
|
||||||
|
if (sinfo->si_code != CLD_EXITED) return;
|
||||||
|
int sav_errno = errno, status;
|
||||||
|
while(true) {
|
||||||
|
if (waitpid(sinfo->si_pid, &status, WNOHANG) == -1) {
|
||||||
|
if (errno != EINTR) break;
|
||||||
|
} else break;
|
||||||
|
}
|
||||||
|
errno = sav_errno;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject*
|
||||||
|
install_sigchld_handler(PyObject UNUSED *self) {
|
||||||
|
struct sigaction sa;
|
||||||
|
sa.sa_flags = SA_SIGINFO;
|
||||||
|
sa.sa_sigaction = handle_sigchld;
|
||||||
|
sigemptyset(&sa.sa_mask);
|
||||||
|
if (sigaction(SIGCHLD, &sa, NULL) == -1) return PyErr_SetFromErrno(PyExc_OSError);
|
||||||
|
Py_RETURN_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WITH_PROFILER
|
#ifdef WITH_PROFILER
|
||||||
static PyObject*
|
static PyObject*
|
||||||
start_profiler(PyObject UNUSED *self, PyObject *args) {
|
start_profiler(PyObject UNUSED *self, PyObject *args) {
|
||||||
@@ -105,6 +129,7 @@ static PyMethodDef module_methods[] = {
|
|||||||
{"redirect_std_streams", (PyCFunction)redirect_std_streams, METH_VARARGS, ""},
|
{"redirect_std_streams", (PyCFunction)redirect_std_streams, METH_VARARGS, ""},
|
||||||
{"wcwidth", (PyCFunction)wcwidth_wrap, METH_O, ""},
|
{"wcwidth", (PyCFunction)wcwidth_wrap, METH_O, ""},
|
||||||
{"change_wcwidth", (PyCFunction)change_wcwidth_wrap, METH_O, ""},
|
{"change_wcwidth", (PyCFunction)change_wcwidth_wrap, METH_O, ""},
|
||||||
|
{"install_sigchld_handler", (PyCFunction)install_sigchld_handler, METH_NOARGS, ""},
|
||||||
#ifdef WITH_PROFILER
|
#ifdef WITH_PROFILER
|
||||||
{"start_profiler", (PyCFunction)start_profiler, METH_VARARGS, ""},
|
{"start_profiler", (PyCFunction)start_profiler, METH_VARARGS, ""},
|
||||||
{"stop_profiler", (PyCFunction)stop_profiler, METH_NOARGS, ""},
|
{"stop_profiler", (PyCFunction)stop_profiler, METH_NOARGS, ""},
|
||||||
|
|||||||
51
kitty/keys.c
51
kitty/keys.c
@@ -89,31 +89,32 @@ get_localized_key(int key, int scancode) {
|
|||||||
switch(name[0]) {
|
switch(name[0]) {
|
||||||
#define K(ch, name) case ch: return GLFW_KEY_##name
|
#define K(ch, name) case ch: return GLFW_KEY_##name
|
||||||
// key names {{{
|
// key names {{{
|
||||||
K('A', A);
|
K('A', A); K('a', A);
|
||||||
K('B', B);
|
K('B', B); K('b', B);
|
||||||
K('C', C);
|
K('C', C); K('c', C);
|
||||||
K('D', D);
|
K('D', D); K('d', D);
|
||||||
K('E', E);
|
K('E', E); K('e', E);
|
||||||
K('F', F);
|
K('F', F); K('f', F);
|
||||||
K('G', G);
|
K('G', G); K('g', G);
|
||||||
K('H', H);
|
K('H', H); K('h', H);
|
||||||
K('I', I);
|
K('I', I); K('i', I);
|
||||||
K('J', J);
|
K('J', J); K('j', J);
|
||||||
K('K', K);
|
K('K', K); K('k', K);
|
||||||
K('L', L);
|
K('L', L); K('l', L);
|
||||||
K('M', M);
|
K('M', M); K('m', M);
|
||||||
K('N', N);
|
K('N', N); K('n', N);
|
||||||
K('O', O);
|
K('O', O); K('o', O);
|
||||||
K('P', P);
|
K('P', P); K('p', P);
|
||||||
K('Q', Q);
|
K('Q', Q); K('q', Q);
|
||||||
K('S', S);
|
K('R', R); K('r', R);
|
||||||
K('T', T);
|
K('S', S); K('s', S);
|
||||||
K('U', U);
|
K('T', T); K('t', T);
|
||||||
K('V', V);
|
K('U', U); K('u', U);
|
||||||
K('W', W);
|
K('V', V); K('v', V);
|
||||||
K('X', X);
|
K('W', W); K('w', W);
|
||||||
K('Y', Y);
|
K('X', X); K('x', X);
|
||||||
K('Z', Z);
|
K('Y', Y); K('y', Y);
|
||||||
|
K('Z', Z); K('z', Z);
|
||||||
K('0', 0);
|
K('0', 0);
|
||||||
K('1', 1);
|
K('1', 1);
|
||||||
K('2', 2);
|
K('2', 2);
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
|
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import errno
|
|
||||||
import locale
|
import locale
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
@@ -25,8 +24,8 @@ from .fast_data_types import (
|
|||||||
GLFW_OPENGL_FORWARD_COMPAT, GLFW_OPENGL_PROFILE, GLFW_SAMPLES,
|
GLFW_OPENGL_FORWARD_COMPAT, GLFW_OPENGL_PROFILE, GLFW_SAMPLES,
|
||||||
GLFW_STENCIL_BITS, GLFWWindow, change_wcwidth, check_for_extensions,
|
GLFW_STENCIL_BITS, GLFWWindow, change_wcwidth, check_for_extensions,
|
||||||
clear_buffers, glewInit, glfw_init, glfw_init_hint_string,
|
clear_buffers, glewInit, glfw_init, glfw_init_hint_string,
|
||||||
glfw_swap_interval, glfw_terminate, glfw_window_hint, set_logical_dpi,
|
glfw_swap_interval, glfw_terminate, glfw_window_hint,
|
||||||
set_options
|
install_sigchld_handler, set_logical_dpi, set_options
|
||||||
)
|
)
|
||||||
from .layout import all_layouts
|
from .layout import all_layouts
|
||||||
from .utils import color_as_int, detach, get_logical_dpi, safe_print
|
from .utils import color_as_int, detach, get_logical_dpi, safe_print
|
||||||
@@ -245,19 +244,6 @@ def setup_profiling(args):
|
|||||||
print('To view the graphical call data, use: kcachegrind', cg)
|
print('To view the graphical call data, use: kcachegrind', cg)
|
||||||
|
|
||||||
|
|
||||||
def reap_zombies(*a):
|
|
||||||
while True:
|
|
||||||
try:
|
|
||||||
pid, status = os.waitpid(-1, os.WNOHANG)
|
|
||||||
if pid == 0:
|
|
||||||
break
|
|
||||||
except OSError as err:
|
|
||||||
if err.errno != errno.EINTR:
|
|
||||||
break
|
|
||||||
except Exception:
|
|
||||||
break
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
try:
|
try:
|
||||||
sys.setswitchinterval(1000.0) # we have only a single python thread
|
sys.setswitchinterval(1000.0) # we have only a single python thread
|
||||||
@@ -302,7 +288,7 @@ def main():
|
|||||||
try:
|
try:
|
||||||
with setup_profiling(args):
|
with setup_profiling(args):
|
||||||
# Avoid needing to launch threads to reap zombies
|
# Avoid needing to launch threads to reap zombies
|
||||||
signal.signal(signal.SIGCHLD, reap_zombies)
|
install_sigchld_handler()
|
||||||
run_app(opts, args)
|
run_app(opts, args)
|
||||||
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
|
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
Reference in New Issue
Block a user