From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: ray.ni@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Wed, 25 Sep 2019 11:17:04 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Sep 2019 11:17:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,548,1559545200"; d="scan'208";a="193857678" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga006.jf.intel.com with ESMTP; 25 Sep 2019 11:17:03 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Sep 2019 11:17:03 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Sep 2019 11:17:03 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.23]) with mapi id 14.03.0439.000; Thu, 26 Sep 2019 02:17:01 +0800 From: "Ni, Ray" To: "devel@edk2.groups.io" , "Gao, Zhichao" CC: "Wang, Jian J" , "Wu, Hao A" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/TerminalDxe: Enhance the arrow keys support Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg/TerminalDxe: Enhance the arrow keys support Thread-Index: AQHVc5rEafjOdg5yU0+ZUW5wYHnT06c8sizQ Date: Wed, 25 Sep 2019 18:17:01 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C2F1BE6@SHSMSX104.ccr.corp.intel.com> References: <20190925120925.12600-1-zhichao.gao@intel.com> In-Reply-To: <20190925120925.12600-1-zhichao.gao@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODJmMmVjNTUtMjljOS00MTE5LWFiYzYtNzI4ZjFkYTY4MmExIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibUZuUmxSXC9VeEZTMnBHNDN3a0FEVTJMMjhTU2JIdmdObkpIT0szWGRmV2JFa0JwY2hid3hCYkRubm53OFF2Y1gifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Zhichao, The four new modes you newly added are supported by putty. But I do not th= ink Putty is the standard the terminal driver needs to follow.=20 So, 1. can you please remove the "putty" from the comments (maybe code)? 2. can you please find the sources where each mode is defined and double c= heck whether the change you make is following the mode definition? It avoid= s you make Putty happy but make other good-behavior terminal software unhap= py. Thanks, Ray > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Gao, Zhic= hao > Sent: Wednesday, September 25, 2019 5:09 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A = ; Ni, Ray ; Gao, Liming > > Subject: [edk2-devel] [PATCH] MdeModulePkg/TerminalDxe: Enhance the arro= w keys support >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2219 >=20 > Refer to > https://www.ssh.com/ssh/putty/putty-manuals/0.68/Chapter4.html#config-ap= pcursor > In normal mode, arrow key would send ESC [A through to ESC [D. > In application mode, arrow key would send ESC OA through to > ESC OD. >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Cc: Liming Gao > Signed-off-by: Zhichao Gao > --- > .../Console/TerminalDxe/TerminalConIn.c | 46 ++++++++++++++++--- > 1 file changed, 40 insertions(+), 6 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c > b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c > index ac31f27984..fdb1a0f1ef 100644 > --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c > +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c > @@ -1402,10 +1402,7 @@ UnicodeToEfiKey ( > continue; > } >=20 > - if (UnicodeChar =3D=3D 'O' && (TerminalDevice->TerminalType =3D= =3D TerminalTypeVt100 || > - TerminalDevice->TerminalType =3D=3D Te= rminalTypeTtyTerm || > - TerminalDevice->TerminalType =3D=3D Te= rminalTypeXtermR6 || > - TerminalDevice->TerminalType =3D=3D Te= rminalTypeVt100Plus)) { > + if (UnicodeChar =3D=3D 'O') { > TerminalDevice->InputState |=3D INPUT_STATE_O; > TerminalDevice->ResetState =3D RESET_STATE_DEFAULT; > continue; > @@ -1631,6 +1628,35 @@ UnicodeToEfiKey ( > } > } >=20 > + // > + // In Putty application mode, the arrow keys would send > + // ESC OA through to ESC OD > + // > + if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVt100 || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVt100Plus || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVtUtf8 || > + TerminalDevice->TerminalType =3D=3D TerminalTypeTtyTerm || > + TerminalDevice->TerminalType =3D=3D TerminalTypeLinux || > + TerminalDevice->TerminalType =3D=3D TerminalTypeXtermR6 || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVt400 || > + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { > + switch (UnicodeChar) { > + case 'A': > + Key.ScanCode =3D SCAN_UP; > + break; > + case 'B': > + Key.ScanCode =3D SCAN_DOWN; > + break; > + case 'C': > + Key.ScanCode =3D SCAN_RIGHT; > + break; > + case 'D': > + Key.ScanCode =3D SCAN_LEFT; > + break; > + } > + } > + > if (Key.ScanCode !=3D SCAN_NULL) { > Key.UnicodeChar =3D 0; > EfiKeyFiFoInsertOneKey (TerminalDevice, &Key); > @@ -1668,10 +1694,18 @@ UnicodeToEfiKey ( >=20 > Key.ScanCode =3D SCAN_NULL; >=20 > + // > + // In Putty normal mode, the arrow keys would send > + // ESC [A through to [D > + // > if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || > TerminalDevice->TerminalType =3D=3D TerminalTypeVt100 || > - TerminalDevice->TerminalType =3D=3D TerminalTypeVtUtf8 || > - TerminalDevice->TerminalType =3D=3D TerminalTypeTtyTerm || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVt100Plus || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVtUtf8 || > + TerminalDevice->TerminalType =3D=3D TerminalTypeTtyTerm || > + TerminalDevice->TerminalType =3D=3D TerminalTypeLinux || > + TerminalDevice->TerminalType =3D=3D TerminalTypeXtermR6 || > + TerminalDevice->TerminalType =3D=3D TerminalTypeVt400 || > TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { > switch (UnicodeChar) { > case 'A': > -- > 2.21.0.windows.1 >=20 >=20 >=20