0
votes

I'm working on creating a new extension for VSCode using typescript. I've got almost everything working but I'd like to make the terminal I've created (using vscode.window.createTerminal()) visible. I've been able to send text to run commands and I thought that .show would work, but it did not. Is there something that I'm missing?

if (!hugoTerminal) {
  hugoTerminal = vscode.window.createTerminal({
    name: 'Hugo Server'
  });
}

let execCommand = 'hugo server ' + previewArguments + ' -s ' + vscode.workspace.rootPath;
hugoTerminal.sendText( execCommand );

hugoTerminal.show;

Thanks!

1

1 Answers

1
votes

I can't comment so I just post this here. Show is a function so you need the ().

show(preserveFocus?: boolean): void

https://code.visualstudio.com/api/references/vscode-api#Terminal

Don't worry we all make that mistake. Congrats!