Skip to content

Commit

Permalink
Raw mode report ESC ESC as Escape
Browse files Browse the repository at this point in the history
  • Loading branch information
ajalt committed Jul 28, 2024
1 parent 565199e commit 62bc16e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Unreleased
### Fixed
- Fixed raw mode on macos for JVM and native not using the correct termios constants. [(#180)](https://github.com/ajalt/mordant/issues/180)
- Fixed raw mode on macOS for JVM and native not using the correct termios constants. [(#180)](https://github.com/ajalt/mordant/issues/180)
- Raw mode on macOS and Linux will now report the `ESC ESC` sequence as an `Escape` key event.

## 2.7.1
## Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,10 @@ internal abstract class SyscallHandlerPosix : SyscallHandler {
try {
read()
} catch (e: RuntimeException) {
return SysInputEvent.Success(
KeyboardEvent(
key = "Escape",
ctrl = false,
alt = false,
shift = false
)
)
return SysInputEvent.Success(KeyboardEvent("Escape"))
}
if (ch == ESC) {
read()
return SysInputEvent.Success(KeyboardEvent("Escape"))
}
}

Expand Down

0 comments on commit 62bc16e

Please sign in to comment.