diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-10-15 11:30:18 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-10-15 11:30:18 +0300 |
commit | e307e56d5591f844c77425a9e72dca6c1cabd766 (patch) | |
tree | 63bf8336a47232297a1fc7aae9a07595b42b3d78 /src | |
parent | 820f716dd16008eef386f6541fa76dcbac793a9b (diff) | |
download | sciteco-e307e56d5591f844c77425a9e72dca6c1cabd766.tar.gz |
netbsd-curses: fixed the default escape delay
* Apparently, netbsd-curses overwrites the escdelay on initscr() (if $ESCDELAY is not set),
so we have to apply the default 25ms after screen initialization.
* The info line is not drawn correctly on netbsd-curses, but only on st/simpleterm.
I assume this is just a shortcoming of the included terminfo entry.
Diffstat (limited to 'src')
-rw-r--r-- | src/interface-curses/interface.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c index 131f474..95e86c9 100644 --- a/src/interface-curses/interface.c +++ b/src/interface-curses/interface.c @@ -635,28 +635,6 @@ teco_interface_init_interactive(GError **error) return FALSE; /* - * On UNIX terminals, the escape key is usually - * delivered as the escape character even though function - * keys are delivered as escape sequences as well. - * That's why there has to be a timeout for detecting - * escape presses if function key handling is enabled. - * This timeout can be controlled using $ESCDELAY on - * ncurses but its default is much too long. - * We set it to 25ms as Vim does. In the very rare cases - * this won't suffice, $ESCDELAY can still be set explicitly. - * - * NOTE: The only terminal emulator I'm aware of that lets - * us send an escape sequence for the escape key is Mintty - * (see "\e[?7727h"). - * - * FIXME: This appears to be ineffective for netbsd-curses. - */ -#ifdef CURSES_TTY - if (!g_getenv("ESCDELAY")) - set_escdelay(25); -#endif - - /* * $TERM must be unset or "#win32con" for the win32 * driver to load. * So we always ignore any $TERM changes by the user. @@ -688,6 +666,28 @@ teco_interface_init_interactive(GError **error) teco_interface_init_screen(); /* + * On UNIX terminals, the escape key is usually + * delivered as the escape character even though function + * keys are delivered as escape sequences as well. + * That's why there has to be a timeout for detecting + * escape presses if function key handling is enabled. + * This timeout can be controlled using $ESCDELAY on + * ncurses but its default is much too long. + * We set it to 25ms as Vim does. In the very rare cases + * this won't suffice, $ESCDELAY can still be set explicitly. + * + * NOTE: The only terminal emulator I'm aware of that lets + * us send an escape sequence for the escape key is Mintty + * (see "\e[?7727h"). + * + * NOTE: The delay is overwritten by initscr() on netbsd-curses. + */ +#ifdef CURSES_TTY + if (!g_getenv("ESCDELAY")) + set_escdelay(25); +#endif + + /* * We always have a CTRL handler on Windows, but doing it * here again, ensures that we have a higher precedence * than the one installed by PDCurses. |