@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/inshellisense",
3
- "version": "0.0.1-rc.15",
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 --loader ts-node/esm src/index.ts -V",
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 --loader ts-node/esm src/index.ts -V",
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.651.0",
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
- "ts-node": "^10.9.2",
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 != $ZDOTDIR ]]; then
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,4 +1,9 @@
1
1
  if [[ -f $USER_ZDOTDIR/.zlogin ]]; then
2
+ IS_ZDOTDIR=$ZDOTDIR
2
3
  ZDOTDIR=$USER_ZDOTDIR
4
+
3
5
  . $ZDOTDIR/.zlogin
4
- fi
6
+
7
+ USER_ZDOTDIR=$ZDOTDIR
8
+ ZDOTDIR=$IS_ZDOTDIR
9
+ fi
@@ -1,4 +1,9 @@
1
1
  if [[ -f $USER_ZDOTDIR/.zprofile ]]; then
2
+ IS_ZDOTDIR=$ZDOTDIR
2
3
  ZDOTDIR=$USER_ZDOTDIR
4
+
3
5
  . $USER_ZDOTDIR/.zprofile
4
- fi
6
+
7
+ USER_ZDOTDIR=$ZDOTDIR
8
+ ZDOTDIR=$IS_ZDOTDIR
9
+ 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
@@ -44,6 +44,8 @@ __is_escape_value() {
44
44
  token="\x0a"
45
45
  elif [ "$byte" = $'\e' ]; then
46
46
  token="\\x1b"
47
+ elif [ "$byte" = $'\a' ]; then
48
+ token="\\x07"
47
49
  else
48
50
  token="$byte"
49
51
  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; printf (__is_prompt_start); printf (is_user_prompt); printf (__is_prompt_end); end
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
  )