@microsoft/inshellisense 0.0.1-rc.15 → 0.0.1-rc.18
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/LICENSE +21 -21
- package/README.md +7 -4
- package/SECURITY.md +41 -41
- package/build/commands/complete-action.js +10 -0
- package/build/commands/doctor.js +11 -0
- package/build/commands/init.js +13 -7
- package/build/commands/root-action.js +38 -0
- package/build/commands/root.js +1 -0
- package/build/commands/shellenv.js +18 -0
- package/build/index.js +2 -0
- package/build/isterm/commandManager.js +3 -6
- package/build/isterm/pty.js +7 -1
- package/build/runtime/alias.js +3 -3
- package/build/runtime/generator.js +1 -1
- package/build/runtime/parser.js +68 -9
- package/build/runtime/runtime.js +23 -26
- package/build/runtime/suggestion.js +25 -21
- package/build/runtime/utils.js +74 -6
- package/build/ui/ui-doctor.js +41 -0
- package/build/utils/config.js +3 -4
- package/build/utils/log.js +10 -1
- package/build/utils/shell.js +123 -8
- package/package.json +9 -6
- package/scripts/postinstall.js +9 -0
- package/shell/shellIntegration-env.zsh +5 -2
- package/shell/shellIntegration-login.zsh +6 -1
- package/shell/shellIntegration-profile.zsh +6 -1
- package/shell/shellIntegration-rc.zsh +8 -0
- package/shell/shellIntegration.bash +2 -0
- package/shell/shellIntegration.fish +2 -1
- package/shell/shellIntegration.nu +1 -1
- package/shell/shellIntegration.ps1 +1 -1
- package/shell/shellIntegration.xsh +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/inshellisense",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.18",
|
|
4
4
|
"description": "IDE style command line auto complete",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -13,18 +13,20 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
"build/**",
|
|
15
15
|
"shell/**",
|
|
16
|
+
"scripts/**",
|
|
16
17
|
"*.md",
|
|
17
18
|
"LICENSE"
|
|
18
19
|
],
|
|
19
20
|
"scripts": {
|
|
20
21
|
"build": "tsc",
|
|
21
|
-
"dev": "node --
|
|
22
|
+
"dev": "node --import=tsx src/index.ts -V",
|
|
22
23
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
23
24
|
"test:e2e": "tui-test",
|
|
24
25
|
"lint": "eslint src/ --ext .ts,.tsx && prettier src/ --check",
|
|
25
26
|
"lint:fix": "eslint src/ --ext .ts,.tsx --fix && prettier src/ --write",
|
|
26
|
-
"debug": "node --inspect --
|
|
27
|
-
"pre-commit": "lint-staged"
|
|
27
|
+
"debug": "node --inspect --import=tsx src/index.ts -V",
|
|
28
|
+
"pre-commit": "lint-staged",
|
|
29
|
+
"postinstall": "node ./scripts/postinstall.js"
|
|
28
30
|
},
|
|
29
31
|
"repository": {
|
|
30
32
|
"type": "git",
|
|
@@ -40,7 +42,8 @@
|
|
|
40
42
|
"homepage": "https://github.com/microsoft/inshellisense#readme",
|
|
41
43
|
"dependencies": {
|
|
42
44
|
"@homebridge/node-pty-prebuilt-multiarch": "^0.11.12",
|
|
43
|
-
"@withfig/autocomplete": "2.
|
|
45
|
+
"@withfig/autocomplete": "2.675.0",
|
|
46
|
+
"@xterm/addon-unicode11": "^0.8.0",
|
|
44
47
|
"@xterm/headless": "^5.5.0",
|
|
45
48
|
"ajv": "^8.12.0",
|
|
46
49
|
"ansi-escapes": "^6.2.0",
|
|
@@ -76,7 +79,7 @@
|
|
|
76
79
|
"lint-staged": "^15.2.2",
|
|
77
80
|
"prettier": "3.0.3",
|
|
78
81
|
"ts-jest": "^29.1.1",
|
|
79
|
-
"
|
|
82
|
+
"tsx": "^4.19.1",
|
|
80
83
|
"typescript": "^5.2.2"
|
|
81
84
|
},
|
|
82
85
|
"lint-staged": {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
|
|
6
|
+
if (fs.existsSync("./build/commands/init.js")) {
|
|
7
|
+
const init = (await import("../build/commands/init.js")).default;
|
|
8
|
+
init.parse(["--generate-full-configs"], { from: "user" });
|
|
9
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
if [[ -f $USER_ZDOTDIR/.zshenv ]]; then
|
|
2
|
+
IS_ZDOTDIR=$ZDOTDIR
|
|
2
3
|
ZDOTDIR=$USER_ZDOTDIR
|
|
3
4
|
|
|
4
5
|
# prevent recursion
|
|
5
|
-
if [[ $USER_ZDOTDIR != $
|
|
6
|
-
ZDOTDIR=$USER_ZDOTDIR
|
|
6
|
+
if [[ $USER_ZDOTDIR != $IS_ZDOTDIR ]]; then
|
|
7
7
|
. $USER_ZDOTDIR/.zshenv
|
|
8
8
|
fi
|
|
9
|
+
|
|
10
|
+
USER_ZDOTDIR=$ZDOTDIR
|
|
11
|
+
ZDOTDIR=$IS_ZDOTDIR
|
|
9
12
|
fi
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
autoload -U add-zsh-hook
|
|
2
|
+
|
|
1
3
|
if [[ -f $USER_ZDOTDIR/.zshrc ]]; then
|
|
2
4
|
ZDOTDIR=$USER_ZDOTDIR
|
|
3
5
|
. $USER_ZDOTDIR/.zshrc
|
|
@@ -25,6 +27,12 @@ __is_escape_value() {
|
|
|
25
27
|
token="\\\\"
|
|
26
28
|
elif [ "$byte" = ";" ]; then
|
|
27
29
|
token="\\x3b"
|
|
30
|
+
elif [ "$byte" = $'\n' ]; then
|
|
31
|
+
token="\x0a"
|
|
32
|
+
elif [ "$byte" = $'\e' ]; then
|
|
33
|
+
token="\\x1b"
|
|
34
|
+
elif [ "$byte" = $'\a' ]; then
|
|
35
|
+
token="\\x07"
|
|
28
36
|
else
|
|
29
37
|
token="$byte"
|
|
30
38
|
fi
|
|
@@ -9,6 +9,7 @@ function __is_escape_value
|
|
|
9
9
|
| string replace -a '\\' '\\\\' \
|
|
10
10
|
| string replace -a ';' '\\x3b' \
|
|
11
11
|
| string replace -a \e '\\x1b' \
|
|
12
|
+
| string replace -a \a '\\x07' \
|
|
12
13
|
| string split \n | string join '\x0a' \
|
|
13
14
|
;
|
|
14
15
|
end
|
|
@@ -19,4 +20,4 @@ if [ "$ISTERM_TESTING" = "1" ]
|
|
|
19
20
|
function is_user_prompt; printf '> '; end
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
function fish_prompt;
|
|
23
|
+
function fish_prompt; __is_prompt_start; is_user_prompt; __is_prompt_end; end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let __is_escape_value = {|x| $x | str replace --all "\\" "\\\\" | str replace --all ";" "\\x3b" | str replace --all "\n" '\x0a' | str replace --all "\e" "\\x1b" }
|
|
1
|
+
let __is_escape_value = {|x| $x | str replace --all "\\" "\\\\" | str replace --all ";" "\\x3b" | str replace --all "\n" '\x0a' | str replace --all "\e" "\\x1b" | str replace --all "\a" "\\x07" }
|
|
2
2
|
let __is_original_PROMPT_COMMAND = if 'PROMPT_COMMAND' in $env { $env.PROMPT_COMMAND } else { "" }
|
|
3
3
|
let __is_original_PROMPT_INDICATOR = if 'PROMPT_INDICATOR' in $env { $env.PROMPT_INDICATOR } else { "" }
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ if ($env:ISTERM_TESTING -eq "1") {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
function Global:__IS-Escape-Value([string]$value) {
|
|
11
|
-
[regex]::Replace($value, "[$([char]0x1b)\\\n;]", { param($match)
|
|
11
|
+
[regex]::Replace($value, "[$([char]0x1b)$([char]0x07)\\\n;]", { param($match)
|
|
12
12
|
-Join (
|
|
13
13
|
[System.Text.Encoding]::UTF8.GetBytes($match.Value) | ForEach-Object { '\x{0:x2}' -f $_ }
|
|
14
14
|
)
|
|
@@ -12,7 +12,7 @@ def __is_escape_value(value: str) -> str:
|
|
|
12
12
|
byte_list = [bytes([byte]).decode("utf-8") for byte in list(value.encode("utf-8"))]
|
|
13
13
|
return "".join(
|
|
14
14
|
[
|
|
15
|
-
"\\x3b" if byte == ";" else "\\\\" if byte == "\\" else "\\x1b" if byte == "\x1b" else "\x0a" if byte == "\n" else byte
|
|
15
|
+
"\\x3b" if byte == ";" else "\\\\" if byte == "\\" else "\\x1b" if byte == "\x1b" else "\x0a" if byte == "\n"else "\\x07" if byte == "\x07" else byte
|
|
16
16
|
for byte in byte_list
|
|
17
17
|
]
|
|
18
18
|
)
|