@microsoft/inshellisense 0.0.1-rc.18 → 0.0.1-rc.19
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/README.md
CHANGED
package/build/isterm/pty.js
CHANGED
|
@@ -257,7 +257,9 @@ export class ISTerm {
|
|
|
257
257
|
if (!sameAccents) {
|
|
258
258
|
ansiLine.push(this._getAnsiAccents(cell));
|
|
259
259
|
}
|
|
260
|
-
|
|
260
|
+
const isWide = prevCell?.getWidth() == 2 && cell?.getWidth() == 0;
|
|
261
|
+
const cursorForward = isWide ? "" : ansi.cursorForward();
|
|
262
|
+
ansiLine.push(chars == "" ? cursorForward : chars);
|
|
261
263
|
prevCell = cell;
|
|
262
264
|
}
|
|
263
265
|
return ansiLine.join("");
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/inshellisense",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.19",
|
|
4
4
|
"description": "IDE style command line auto complete",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=16.6.0 <
|
|
7
|
+
"node": ">=16.6.0 <23.0.0"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
10
|
"inshellisense": "./build/index.js",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"lint": "eslint src/ --ext .ts,.tsx && prettier src/ --check",
|
|
26
26
|
"lint:fix": "eslint src/ --ext .ts,.tsx --fix && prettier src/ --write",
|
|
27
27
|
"debug": "node --inspect --import=tsx src/index.ts -V",
|
|
28
|
+
"reinstall": "rm -rf node_modules && npm install",
|
|
28
29
|
"pre-commit": "lint-staged",
|
|
29
30
|
"postinstall": "node ./scripts/postinstall.js"
|
|
30
31
|
},
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
},
|
|
42
43
|
"homepage": "https://github.com/microsoft/inshellisense#readme",
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@homebridge/node-pty-prebuilt-multiarch": "^0.11.
|
|
45
|
+
"@homebridge/node-pty-prebuilt-multiarch": "^0.11.14",
|
|
45
46
|
"@withfig/autocomplete": "2.675.0",
|
|
46
47
|
"@xterm/addon-unicode11": "^0.8.0",
|
|
47
48
|
"@xterm/headless": "^5.5.0",
|
|
@@ -20,4 +20,9 @@ if [ "$ISTERM_TESTING" = "1" ]
|
|
|
20
20
|
function is_user_prompt; printf '> '; end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
function fish_prompt;
|
|
23
|
+
function fish_prompt;
|
|
24
|
+
set --local __user_prompt_lines (is_user_prompt)
|
|
25
|
+
set --local __user_prompt (string join '\n' $__user_prompt_lines)
|
|
26
|
+
set --local __prompt (string join '' (__is_prompt_start) $__user_prompt (__is_prompt_end))
|
|
27
|
+
printf $__prompt
|
|
28
|
+
end
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import os from "node:os";
|
|
4
|
-
import { getSuggestions } from "../runtime/runtime.js";
|
|
5
|
-
import { Shell } from "../utils/shell.js";
|
|
6
|
-
export const action = async (input) => {
|
|
7
|
-
const suggestions = await getSuggestions(input, process.cwd(), os.platform() === "win32" ? Shell.Cmd : Shell.Bash);
|
|
8
|
-
process.stdout.write(JSON.stringify(suggestions));
|
|
9
|
-
process.exit(0);
|
|
10
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import { render, renderConfirmation } from "../ui/ui-root.js";
|
|
4
|
-
import { Shell, supportedShells as shells, setupZshDotfiles, setupBashPreExec } from "../utils/shell.js";
|
|
5
|
-
import { inferShell } from "../utils/shell.js";
|
|
6
|
-
import { loadConfig } from "../utils/config.js";
|
|
7
|
-
import log from "../utils/log.js";
|
|
8
|
-
import { loadAliases } from "../runtime/alias.js";
|
|
9
|
-
import { loadLocalSpecsSet } from "../runtime/runtime.js";
|
|
10
|
-
import { program } from "./root.js";
|
|
11
|
-
export const supportedShells = shells.join(", ");
|
|
12
|
-
export const action = async (options) => {
|
|
13
|
-
const inISTerm = process.env.ISTERM === "1";
|
|
14
|
-
if (options.check || inISTerm) {
|
|
15
|
-
process.stdout.write(renderConfirmation(inISTerm));
|
|
16
|
-
process.exit(0);
|
|
17
|
-
}
|
|
18
|
-
if (options.verbose)
|
|
19
|
-
await log.enable();
|
|
20
|
-
await loadConfig(program);
|
|
21
|
-
await loadLocalSpecsSet();
|
|
22
|
-
const shell = options.shell ?? (await inferShell());
|
|
23
|
-
if (shell == null) {
|
|
24
|
-
program.error(`Unable to identify shell, use the -s/--shell option to provide your shell`, { exitCode: 1 });
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (!shells.map((s) => s.valueOf()).includes(shell)) {
|
|
28
|
-
program.error(`Unsupported shell: '${shell}', supported shells: ${supportedShells}`, { exitCode: 1 });
|
|
29
|
-
}
|
|
30
|
-
if (shell == Shell.Zsh) {
|
|
31
|
-
await setupZshDotfiles();
|
|
32
|
-
}
|
|
33
|
-
else if (shell == Shell.Bash) {
|
|
34
|
-
await setupBashPreExec();
|
|
35
|
-
}
|
|
36
|
-
await loadAliases(shell);
|
|
37
|
-
await render(shell, options.test ?? false, options.login ?? false);
|
|
38
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import { Command } from "commander";
|
|
4
|
-
import { shellEnvSupportedShells as shells, getShellConfig } from "../utils/shell.js";
|
|
5
|
-
const supportedShells = shells.join(", ");
|
|
6
|
-
const action = (program) => async (shell) => {
|
|
7
|
-
if (!shells.map((s) => s.valueOf()).includes(shell)) {
|
|
8
|
-
program.error(`Unsupported shell: '${shell}', supported shells: ${supportedShells}`, { exitCode: 1 });
|
|
9
|
-
}
|
|
10
|
-
const config = getShellConfig(shell);
|
|
11
|
-
process.stdout.write(`\n\n# ---------------- inshellisense shell plugin ----------------\n${config}`);
|
|
12
|
-
process.exit(0);
|
|
13
|
-
};
|
|
14
|
-
const cmd = new Command("shellenv");
|
|
15
|
-
cmd.description(`generates shell configurations for the provided shell`);
|
|
16
|
-
cmd.argument("<shell>", `shell to generate configuration for, supported shells: ${supportedShells}`);
|
|
17
|
-
cmd.action(action(cmd));
|
|
18
|
-
export default cmd;
|