Skip to content

Commit 450da2e

Browse files
committed
Fix issues with Node interception & git-bash on Windows
1 parent 1fb755a commit 450da2e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/interceptors/terminal/fresh-terminal-interceptor.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ const appendToFirstExisting = async (paths: string[], forceWrite: boolean, conte
221221
const START_CONFIG_SECTION = '# --httptoolkit--';
222222
const END_CONFIG_SECTION = '# --httptoolkit-end--';
223223

224+
// The shell config required to ensure every spawned shell always has the right
225+
// configuration, even if it has its env vars reset somehow. This also includes
226+
// fixes for winpty with git-bash. By default, winpty will intercept known
227+
// commands to manage them, so our PATH overrides never get run. We avoid that
228+
// with trivial aliases, and then run winpty ourselves inside the overrides.
229+
224230
// Works in bash, zsh, dash, ksh, sh (not fish)
225231
const SH_SHELL_PATH_CONFIG = `
226232
${START_CONFIG_SECTION}
@@ -232,6 +238,7 @@ if [ -n "$HTTP_TOOLKIT_ACTIVE" ]; then
232238
if command -v winpty >/dev/null 2>&1; then
233239
# Work around for winpty's hijacking of certain commands
234240
alias php=php
241+
alias node=node
235242
fi
236243
fi
237244
${END_CONFIG_SECTION}`;
@@ -245,6 +252,7 @@ if [ -n "$HTTP_TOOLKIT_ACTIVE" ]
245252
if command -v winpty >/dev/null 2>&1
246253
# Work around for winpty's hijacking of certain commands
247254
alias php=php
255+
alias node=node
248256
end
249257
end
250258
${END_CONFIG_SECTION}`;

0 commit comments

Comments
 (0)