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

Calling spawn with an invalid path causes .spawn to never return #138

Open
Tyriar opened this issue Aug 28, 2017 · 2 comments
Open

Calling spawn with an invalid path causes .spawn to never return #138

Tyriar opened this issue Aug 28, 2017 · 2 comments
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@Tyriar
Copy link
Member

Tyriar commented Aug 28, 2017

@Tyriar Tyriar added the bug Issue identified by VS Code Team member as probable bug label Aug 28, 2017
@Tyriar Tyriar self-assigned this Aug 28, 2017
@Tyriar Tyriar added this to the 0.7.1 milestone Aug 28, 2017
@Tyriar
Copy link
Member Author

Tyriar commented Aug 28, 2017

Struggling to reproduce the hanging call in node-pty 😕. The following test ends up calling the same native API but throws a Node.js exception just fine:

  describe('WindowsTerminal', () => {
    describe('constructor', () => {
      describe('given an invalid launch path', () => {
        it('should fail gracefully', () => {
          // const term = new WindowsTerminal('');
          // const term = new WindowsTerminal('some_file_not_on_the_path');
          const term = new WindowsTerminal('C:\\WINDOWS\\System32', '', {
            name: "System32",
            cwd: "C:\\Users\\daimms.REDMOND\\Documents\\playground\\t",
          });
        });
      });
    });
  });
  23 passing (552ms)
  1 failing

  1) WindowsTerminal constructor given an invalid launch path should fail gracefully:
     Error: File not found: C:\WINDOWS\System32
      at new WindowsPtyAgent (lib\windowsPtyAgent.js:25:24)
      at new WindowsTerminal (lib\windowsTerminal.js:45:24)
      at Context.<anonymous> (lib\windowsTerminal.test.js:16:32)

@Tyriar
Copy link
Member Author

Tyriar commented Aug 28, 2017

One way to be sure about this is to use which #112 and validate this on the JS side. One perk here is a lot of C++ code can be removed from path_utils.cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

1 participant