fix: windows powershell shell integration & backspace (#183)

* fix: windows powershell shellIntegration & backspace

Signed-off-by: Chapman Pendery <cpendery@vt.edu>

* fix: include cmd in backspace fix

Signed-off-by: Chapman Pendery <cpendery@vt.edu>

---------

Signed-off-by: Chapman Pendery <cpendery@vt.edu>
This commit is contained in:
Chapman Pendery
2024-03-04 17:53:43 -08:00
committed by GitHub
parent 5c78bf4974
commit 6ec8358151
2 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -254,7 +254,8 @@ const convertToPtyTarget = async (shell: Shell) => {
case Shell.Bash:
shellArgs = ["--init-file", path.join(shellFolderPath, "shellIntegration.bash")];
break;
case (Shell.Powershell, Shell.Pwsh):
case Shell.Powershell:
case Shell.Pwsh:
shellArgs = ["-noexit", "-command", `try { . "${path.join(shellFolderPath, "shellIntegration.ps1")}" } catch {}`];
break;
case Shell.Fish:
+5 -1
View File
@@ -130,7 +130,11 @@ export const render = async (shell: Shell, underTest: boolean) => {
if (previousSuggestionsRows > 0 && inputHandled) {
term.noop();
} else if (!inputHandled) {
term.write(press.sequence);
if (press.name == "backspace" && (shell === Shell.Pwsh || shell === Shell.Powershell || shell === Shell.Cmd)) {
term.write("\u007F");
} else {
term.write(press.sequence);
}
}
});