noninteractive 0.3.33 → 0.3.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/noninteractive.js +17 -1
- package/package.json +1 -1
package/bin/noninteractive.js
CHANGED
|
@@ -404,7 +404,7 @@ var init_daemon = __esm(() => {
|
|
|
404
404
|
var require_package = __commonJS((exports, module) => {
|
|
405
405
|
module.exports = {
|
|
406
406
|
name: "noninteractive",
|
|
407
|
-
version: "0.3.
|
|
407
|
+
version: "0.3.34",
|
|
408
408
|
type: "module",
|
|
409
409
|
bin: {
|
|
410
410
|
noninteractive: "./bin/noninteractive.js"
|
|
@@ -820,6 +820,22 @@ async function send(name, text, wait, timeout, noOpen = false) {
|
|
|
820
820
|
text = "\r";
|
|
821
821
|
text = text.replace(/\\x([0-9a-fA-F]{2})/g, (_, hex) => String.fromCharCode(parseInt(hex, 16))).replace(/\\r/g, "\r").replace(/\\n/g, `
|
|
822
822
|
`).replace(/\\t/g, "\t");
|
|
823
|
+
const keyHints = {
|
|
824
|
+
ENTER: "\\r",
|
|
825
|
+
RETURN: "\\r",
|
|
826
|
+
DOWN: "\\x1b[B",
|
|
827
|
+
UP: "\\x1b[A",
|
|
828
|
+
LEFT: "\\x1b[D",
|
|
829
|
+
RIGHT: "\\x1b[C",
|
|
830
|
+
TAB: "\\t",
|
|
831
|
+
ESCAPE: "\\x1b",
|
|
832
|
+
ESC: "\\x1b",
|
|
833
|
+
BACKSPACE: "\\x7f"
|
|
834
|
+
};
|
|
835
|
+
const upper = text.replace(/[\s\r\n]/g, "").toUpperCase();
|
|
836
|
+
if (keyHints[upper]) {
|
|
837
|
+
console.error(`hint: "${text}" was sent as literal text. for the ${upper} key, use "${keyHints[upper]}" instead.`);
|
|
838
|
+
}
|
|
823
839
|
const sock = socketPath(name);
|
|
824
840
|
try {
|
|
825
841
|
if (wait) {
|