From c78606f112669652b940e8933c86d3a22bd3c2e1 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 11 May 2020 23:10:50 +0200 Subject: [PATCH 1/2] doc: fix readline key binding documentation The documentation for two key bindings was not correct. Signed-off-by: Ruben Bridgewater --- doc/api/readline.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index 272481a9f155c3..04233f1a591d44 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -750,7 +750,7 @@ const { createInterface } = require('readline'); ctrl + shift + delete Delete line right - Doesn't work on Linux and Mac + Doesn't work on Mac ctrl + c @@ -824,7 +824,7 @@ const { createInterface } = require('readline'); + backspace Delete backwards to a word boundary ctrl + backspace Doesn't - work as expected on Windows + work on Linux, Mac and Windows ctrl + delete From 63b57343757e539ad5c8b65bbf9f47791849f241 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 11 May 2020 23:11:33 +0200 Subject: [PATCH 2/2] doc: update TODO comments This removes one TODO comment and adds another that indicates that readline is currently not able to trigger specific escape sequences. Signed-off-by: Ruben Bridgewater --- lib/readline.js | 6 +++++- test/parallel/test-assert-deep.js | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/readline.js b/lib/readline.js index 4684fe91068b5c..7d44dd2366cf39 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -855,6 +855,8 @@ Interface.prototype._ttyWrite = function(s, key) { if (key.ctrl && key.shift) { /* Control and shift pressed */ switch (key.name) { + // TODO(BridgeAR): The transmitted escape sequence is `\b` and that is + // identical to -h. It should have a unique escape sequence. case 'backspace': this._deleteLineLeft(); break; @@ -952,8 +954,10 @@ Interface.prototype._ttyWrite = function(s, key) { } break; - // TODO(BridgeAR): This seems broken? case 'w': // Delete backwards to a word boundary + // TODO(BridgeAR): The transmitted escape sequence is `\b` and that is + // identical to -h. It should have a unique escape sequence. + // Falls through case 'backspace': this._deleteWordLeft(); break; diff --git a/test/parallel/test-assert-deep.js b/test/parallel/test-assert-deep.js index 454b1920f00aee..73af4b3e226929 100644 --- a/test/parallel/test-assert-deep.js +++ b/test/parallel/test-assert-deep.js @@ -957,8 +957,6 @@ assertDeepAndStrictEqual(obj1, obj2); // Check proxies. { - // TODO(BridgeAR): Check if it would not be better to detect proxies instead - // of just using the proxy value. const arrProxy = new Proxy([1, 2], {}); assert.deepStrictEqual(arrProxy, [1, 2]); const tmp = util.inspect.defaultOptions;