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

Command entered before terminal start #84

Open
dominic-ks opened this issue Jul 27, 2023 · 3 comments
Open

Command entered before terminal start #84

dominic-ks opened this issue Jul 27, 2023 · 3 comments
Labels

Comments

@dominic-ks
Copy link

Hello,

Firstly, thanks for this extension, life saver.

Started having a slight issue though, not a major one, just a bit annoying. I'll hit Terminals: Run, all my terminals open, all the commands are entered, but looks like it goes in before the terminal is actually open and so doesn't execute. Doing Terminals: Run again then runs them as you'd expect.

I'm running WSL2 in Windows 11. Happens across all projects but here's a sample terminals.json anyway:

{
  "autorun": false,
  "terminals": [
    {
      "name": "Firebase Emultators",
      "description": "Run the Firebase Emultators for this project!",
      "command": "firebase emulators:start --only functions,firestore"
    },
    {
      "name": "NestJS Serve",
      "description": "Serve the NestJS project, mainly to keep it building.",
      "command": "nx serve muso-tools-nest:serve" 
    }
  ]
}

Here's what it looks like when it doesn't run the first time:
image

Anything I can do to assist resolving this please say.

@fabiospampinato
Copy link
Owner

Interesting. I should check if there's a clean way to way for the shell to be ready, this is the relevant part of the extension I think:

vscode-terminals/src/run.ts

Lines 135 to 141 in 8f0f724

if ( persistent && i === 1 ) await Utils.delay ( 1500 ); // It may take a while to start the multiplexer
await Utils.delay ( 50 );
const doExecute = execute !== false || i < l - 1; // The last of multiple commands won't be executed
term.sendText ( texts[i], doExecute );

@dominic-ks
Copy link
Author

Cheers, yes, and if not that, then I wonder if that sendText method returns anything? Could possibly retry if it's not successful. Never dived into VS Code extensions, so I have no idea!

@fabiospampinato
Copy link
Owner

It returns void according to the docs, i.e.nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants