You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a terminal with a nonexistent cwd (i.e. a directory that does not exist), the call to createTerminal will not throw an exception even though the terminal will fail to start. The user will see an error notification that says "The terminal process failed to launch: Starting directory (cwd) "/does/not/exist" does not exist.". The call will return a vscode.Terminal object that is not differentiable from a successfully created terminal. Awaiting terminal.processId will block indefinitely.
Overall this seems like unexpected behavior and prone to causing issues in extensions that integrate with the terminal. To get around this, I created a promise that resolves / rejects when vscode.window.onDidCloseTerminal triggers with the returned terminal and await Promise.race between this and the terminal's process ID. This seems to work but is very hacky and I'm not even sure if this consistently works (is it possible for the event to trigger after the call to createTerminal returns before I'm able to register the listener?).
The text was updated successfully, but these errors were encountered:
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.96.2. Please try upgrading to the latest version and checking whether this issue remains.
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
cwd
When creating a terminal with a nonexistent
cwd
(i.e. a directory that does not exist), the call tocreateTerminal
will not throw an exception even though the terminal will fail to start. The user will see an error notification that says "The terminal process failed to launch: Starting directory (cwd) "/does/not/exist" does not exist.". The call will return avscode.Terminal
object that is not differentiable from a successfully created terminal. Awaitingterminal.processId
will block indefinitely.Overall this seems like unexpected behavior and prone to causing issues in extensions that integrate with the terminal. To get around this, I created a promise that resolves / rejects when
vscode.window.onDidCloseTerminal
triggers with the returned terminal and awaitPromise.race
between this and the terminal's process ID. This seems to work but is very hacky and I'm not even sure if this consistently works (is it possible for the event to trigger after the call tocreateTerminal
returns before I'm able to register the listener?).The text was updated successfully, but these errors were encountered: