Skip to content

Commit

Permalink
chore(term): add descriptive error on Windows for lack of VT
Browse files Browse the repository at this point in the history
if no virtual terminal processing is available, raise a descriptive
error instead of a failure on some missing defines.
  • Loading branch information
Tieske committed Jul 21, 2024
1 parent 4549924 commit acb893e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ The scope of what is covered by the version number excludes:

## Version history

### unreleased

- Chore: add compiler error on Windows if Virtual Terminal Processing is unavailable.

### Version 0.4.2, released 25-Jun-2024

- Fix: include additional headers for some MinGW installations
Expand Down
5 changes: 5 additions & 0 deletions src/term.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ typedef struct ls_RegConst {
// This is needed because some flags are not defined on all platforms. So we
// still export the constants, but they will be all 0, and hence not do anything.
#ifdef _WIN32
// check compatibility: Windows virtual terminal processing was added in 2019,
// so requires MS toolchain 2022 or newer.
#ifndef ENABLE_VIRTUAL_TERMINAL_INPUT
#error 2019 and older toolchains are not supported. Update the toolchain or revert to Luasystem < 0.4
#endif
#define CHECK_WIN_FLAG_OR_ZERO(flag) flag
#define CHECK_NIX_FLAG_OR_ZERO(flag) 0
#else
Expand Down

0 comments on commit acb893e

Please sign in to comment.