Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Specify winpty.exe via Environment Variable #692

Closed
hcoona opened this issue Jul 4, 2024 · 3 comments
Closed

[Question] Specify winpty.exe via Environment Variable #692

hcoona opened this issue Jul 4, 2024 · 3 comments

Comments

@hcoona
Copy link

hcoona commented Jul 4, 2024

Environment details

  • OS: Windows 11
  • OS version:
  • node-pty version:

Issue description

Is it possible to specify winpty.exe full path via Environment Variable? I installed it in MSYS2 but I don't what to expose all bins to my PATH.

@Tyriar
Copy link
Member

Tyriar commented Jul 5, 2024

Why are you asking? winpty should be is shipped with node-pty and it gets imported relatively here:

if (!winptyNative) {
try {
winptyNative = require('../build/Release/pty.node');
} catch (outerError) {
try {
winptyNative = require('../build/Debug/pty.node');
} catch (innerError) {
console.error('innerError', innerError);
// Re-throw the exception from the Release require if the Debug require fails as well
throw outerError;
}
}
}

@hcoona
Copy link
Author

hcoona commented Jul 8, 2024

I installed is with pnpm and it cannot find winpty automatically.

E:\pnpm-global\5\.pnpm\@[email protected]\node_modules\@homebridge\node-pty-prebuilt-multiarch\lib\windowsPtyAgent.js:79
            term = this._ptyNative.startProcess(file, cols, rows, debug, this._generatePipeName(), conptyInheritCursor);
                                   ^

Error: File not found:
    at new WindowsPtyAgent (E:\pnpm-global\5\.pnpm\@[email protected]\node_modules\@homebridge\node-pty-prebuilt-multiarch\lib\windowsPtyAgent.js:79:36)
    at new WindowsTerminal (E:\pnpm-global\5\.pnpm\@[email protected]\node_modules\@homebridge\node-pty-prebuilt-multiarch\lib\windowsTerminal.js:53:24)
    at Object.spawn (E:\pnpm-global\5\.pnpm\@[email protected]\node_modules\@homebridge\node-pty-prebuilt-multiarch\lib\index.js:30:12)
    at new ISTerm (file:///E:/pnpm-global/5/.pnpm/@[email protected]/node_modules/@microsoft/inshellisense/build/isterm/pty.js:36:25)
    at Object.spawn (file:///E:/pnpm-global/5/.pnpm/@[email protected]/node_modules/@microsoft/inshellisense/build/isterm/pty.js:279:12)
    at async render (file:///E:/pnpm-global/5/.pnpm/@[email protected]/node_modules/@microsoft/inshellisense/build/ui/ui-root.js:16:18)
    at async Command.<anonymous> (file:///E:/pnpm-global/5/.pnpm/@[email protected]/node_modules/@microsoft/inshellisense/build/commands/root.js:35:5)

Node.js v20.15.0

After I download winpty by myself and added it to PATH, is can run.

And I cannot find winpty.exe anywhere.

@Tyriar
Copy link
Member

Tyriar commented Oct 3, 2024

winpty is definitely compiled after yarn is run (or npm i after #721). Maybe this is an issue with pnpm?

@Tyriar Tyriar closed this as completed Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants