diff --git a/src/isterm/pty.ts b/src/isterm/pty.ts index 889511d..0ec62e8 100644 --- a/src/isterm/pty.ts +++ b/src/isterm/pty.ts @@ -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: diff --git a/src/ui/ui-root.ts b/src/ui/ui-root.ts index c6da1d9..fc1adc6 100644 --- a/src/ui/ui-root.ts +++ b/src/ui/ui-root.ts @@ -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); + } } });