fabiospampinato / vscode-terminals

An extension for setting-up multiple terminals at once, or just running some commands.
MIT License
121 stars 19 forks source link

Command entered before terminal start #84

Open dominic-ks opened 11 months ago

dominic-ks commented 11 months ago

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 commented 11 months ago

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: https://github.com/fabiospampinato/vscode-terminals/blob/8f0f7247acaeaa8f8251f8c2304831167748fe5d/src/run.ts#L135-L141

dominic-ks commented 11 months ago

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 commented 11 months ago

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