Skip to content

Commit

Permalink
Ncurses: use ESCDELAY environment variable instead of a custom one
Browse files Browse the repository at this point in the history
  • Loading branch information
magiblot committed Nov 15, 2024
1 parent b0df20d commit f6d5dcd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ The following environment variables are also taken into account:
* `TERM`: Ncurses uses it to determine terminal capabilities. It is set automatically by the terminal emulator.
* `COLORTERM`: when set to `truecolor` or `24bit`, Turbo Vision will assume the terminal emulator supports 24-bit color. It is set automatically by terminal emulators that support it.
* `TVISION_ESCDELAY`: the number of milliseconds to wait after receiving an ESC key press, default `10`. If another key is pressed during this delay, it will be interpreted as an Alt+Key combination. Using a larger value is useful when the terminal doesn't support the Alt key.
* `ESCDELAY`: the number of milliseconds to wait after receiving an ESC key press, default `10`. If another key is pressed during this delay, it will be interpreted as an Alt+Key combination. Using a larger value is useful when the terminal doesn't support the Alt key.
* `TVISION_USE_STDIO`: when not empty, terminal I/O is performed through `stdin`/`stdout`, so that it can be redirected from the shell. By default, Turbo Vision performs terminal I/O through `/dev/tty`, allowing the user to redirect `stdin`, `stdout` and `stderr` for their needs, without affecting the application's stability.
For example, the following will leave `out.txt` empty:
Expand Down
2 changes: 1 addition & 1 deletion source/platform/ncursinp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ NcursesInput::NcursesInput( ConsoleCtl &aCon, NcursesDisplay &,
/* Do not delay too much on ESC key presses, as the Alt modifier works well
* in most modern terminals. Still, this delay helps ncurses distinguish
* special key sequences, I believe. */
set_escdelay(getEnv<int>("TVISION_ESCDELAY", 10));
set_escdelay(getEnv<int>("ESCDELAY", 10));

TermIO::keyModsOn(con);
if (mouseEnabled)
Expand Down

0 comments on commit f6d5dcd

Please sign in to comment.