终端无法打开

时间:2019-11-13 16:22:44

标签: javascript visual-studio-code vscode-extensions

我尝试使用此功能:

let disposable = vscode.commands.registerCommand('extension.helloWorld', function () {
    vscode.window.createTerminal(`New terminal name`)
});

但是,运行后没有任何反应。

1 个答案:

答案 0 :(得分:0)

函数vscode.window.createTerminal仅创建终端,要显示该终端,您需要调用.show()函数。例如:

function addGroup(sender, recipient, connectionId, groupName) {
        return axios.post(`${apiBaseUrl}/api/addToGroup`, {
          connectionId: connectionId,
          recipient: recipient,
          groupname: groupName
        }, getAxiosConfig()).then(resp => {
          if (resp.status == 200) {
            confirm("Add Successfully")
          }
        });
      }