utilium 3.6.0 → 3.6.1

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.
Files changed (2) hide show
  1. package/dist/shell.js +22 -0
  2. package/package.json +2 -2
package/dist/shell.js CHANGED
@@ -96,6 +96,28 @@ async function handleKey($, key) {
96
96
  $.cursor--;
97
97
  $.stdout.write('\b\x1b[P');
98
98
  break;
99
+ case '\x1b[3~':
100
+ if ($.cursor >= $.input.length) {
101
+ return;
102
+ }
103
+ $.input = $.input.slice(0, $.cursor) + $.input.slice($.cursor + 1);
104
+ $.stdout.write('\x1b[P');
105
+ break;
106
+ case '\x0c': {
107
+ $.stdout.write('\x1b[2J\x1b[H' + $.prompt + $.input);
108
+ const back = $.input.length - $.cursor;
109
+ if (back)
110
+ $.stdout.write(`\x1b[${back}D`);
111
+ break;
112
+ }
113
+ case '\x03':
114
+ $.stdout.write('^C\r\n');
115
+ $.index = -1;
116
+ $.input = '';
117
+ $.currentInput = '';
118
+ $.cursor = 0;
119
+ $.stdout.write($.prompt);
120
+ break;
99
121
  case '\r':
100
122
  if ($.input != $.inputs[0]) {
101
123
  $.inputs.unshift($.input);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilium",
3
- "version": "3.6.0",
3
+ "version": "3.6.1",
4
4
  "description": "Typescript utilities",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -15,7 +15,7 @@
15
15
  "./eslint": "./eslint.shared.js"
16
16
  },
17
17
  "bin": {
18
- "lice": "./scripts/lice.js"
18
+ "lice": "scripts/lice.js"
19
19
  },
20
20
  "files": [
21
21
  "dist",