utilium 0.8.6 → 0.8.8
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/dist/shell.js +4 -4
- package/package.json +1 -1
- package/src/shell.ts +4 -4
package/dist/shell.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
function handleData($, data) {
|
1
|
+
async function handleData($, data) {
|
2
2
|
if ($.index == -1) {
|
3
3
|
$.currentInput = $.input;
|
4
4
|
}
|
@@ -29,12 +29,12 @@ function handleData($, data) {
|
|
29
29
|
}
|
30
30
|
break;
|
31
31
|
case '\x1b[C':
|
32
|
-
if (x < $.
|
32
|
+
if (x < $.input.length) {
|
33
33
|
$.terminal.write(data);
|
34
34
|
}
|
35
35
|
break;
|
36
36
|
case '\x1b[F':
|
37
|
-
$.terminal.write(`\x1b[${$.promptLength + $.
|
37
|
+
$.terminal.write(`\x1b[${$.promptLength + $.input.length + 1}G`);
|
38
38
|
break;
|
39
39
|
case '\x1b[H':
|
40
40
|
$.terminal.write(`\x1b[${$.promptLength + 1}G`);
|
@@ -51,7 +51,7 @@ function handleData($, data) {
|
|
51
51
|
$.inputs.unshift($.input);
|
52
52
|
}
|
53
53
|
$.terminal.write('\r\n');
|
54
|
-
$.onLine($.input);
|
54
|
+
await $.onLine($.input);
|
55
55
|
$.index = -1;
|
56
56
|
$.input = '';
|
57
57
|
$.terminal.write($.prompt);
|
package/package.json
CHANGED
package/src/shell.ts
CHANGED
@@ -45,7 +45,7 @@ export interface ShellContext extends Required<ShellOptions> {
|
|
45
45
|
inputs: string[];
|
46
46
|
}
|
47
47
|
|
48
|
-
function handleData($: ShellContext, data: string) {
|
48
|
+
async function handleData($: ShellContext, data: string) {
|
49
49
|
if ($.index == -1) {
|
50
50
|
$.currentInput = $.input;
|
51
51
|
}
|
@@ -77,12 +77,12 @@ function handleData($: ShellContext, data: string) {
|
|
77
77
|
}
|
78
78
|
break;
|
79
79
|
case '\x1b[C':
|
80
|
-
if (x < $.
|
80
|
+
if (x < $.input.length) {
|
81
81
|
$.terminal.write(data);
|
82
82
|
}
|
83
83
|
break;
|
84
84
|
case '\x1b[F':
|
85
|
-
$.terminal.write(`\x1b[${$.promptLength + $.
|
85
|
+
$.terminal.write(`\x1b[${$.promptLength + $.input.length + 1}G`);
|
86
86
|
break;
|
87
87
|
case '\x1b[H':
|
88
88
|
$.terminal.write(`\x1b[${$.promptLength + 1}G`);
|
@@ -99,7 +99,7 @@ function handleData($: ShellContext, data: string) {
|
|
99
99
|
$.inputs.unshift($.input);
|
100
100
|
}
|
101
101
|
$.terminal.write('\r\n');
|
102
|
-
$.onLine($.input);
|
102
|
+
await $.onLine($.input);
|
103
103
|
$.index = -1;
|
104
104
|
$.input = '';
|
105
105
|
$.terminal.write($.prompt);
|