mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-07 11:09:49 +08:00
Translate \n to \r when receiving text from an IME
Fixes issue with fzf and return using the stock cyanogenmod keyboard reported by @mklein994 on gitter.
This commit is contained in:
@@ -298,6 +298,14 @@ public final class TerminalView extends View {
|
|||||||
|
|
||||||
boolean ctrlHeld = false;
|
boolean ctrlHeld = false;
|
||||||
if (codePoint <= 31 && codePoint != 27) {
|
if (codePoint <= 31 && codePoint != 27) {
|
||||||
|
if (codePoint == '\n') {
|
||||||
|
// The AOSP keyboard and descendants seems to send \n as text when the enter key is pressed,
|
||||||
|
// instead of a key event like most other keyboard apps. A terminal expects \r for the enter
|
||||||
|
// key (although when icrnl is enabled this doesn't make a difference - run 'stty -icrnl' to
|
||||||
|
// check the behaviour).
|
||||||
|
codePoint = '\r';
|
||||||
|
}
|
||||||
|
|
||||||
// E.g. penti keyboard for ctrl input.
|
// E.g. penti keyboard for ctrl input.
|
||||||
ctrlHeld = true;
|
ctrlHeld = true;
|
||||||
switch (codePoint) {
|
switch (codePoint) {
|
||||||
|
Reference in New Issue
Block a user