perf(console): reduce ESC key delay from 1000ms to 25ms

Curses waits up to 1 second after ESC to distinguish it from escape
sequences (arrow keys, F-keys). Set ESCDELAY=25 before curses.initscr()
so ESC responds near-instantly while still handling escape sequences.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 02:22:01 +00:00
parent 274cf30e79
commit f5e0525dfc

View File

@@ -7,6 +7,11 @@ built-in :mod:`curses` library.
"""
import curses
import os
# Reduce ESC key delay from default 1000ms to 25ms.
# Must be set BEFORE curses.initscr() is called.
os.environ.setdefault('ESCDELAY', '25')
from console.config import COLORS_VT220
from console.renderers.base import BaseRenderer