Skip to content

Link run in terminal session with command ID #274179

@meganrogge

Description

@meganrogge

We have:

getTerminalCommandIdByToolSessionId(terminalToolSessionId: string | undefined): string | undefined {
if (!terminalToolSessionId) {
return undefined;
}
if (this._commandIdByToolSessionId.size === 0) {
this._restoreFromStorage();
}
return this._commandIdByToolSessionId.get(terminalToolSessionId);
}

But it fails right now after reload because the command.id differs since it's created once for the renderer and once for the ptyHost here:

Haven't thought it through fully, but here's another idea for associating the tool call with the command which may end up being simpler:

  • Only support linking commands for rich command detection
  • In prepare, create the command ID manually via tool-${generateUuid()} and set on toolSpecificData, this would make serialize of the part just work at long as we restore the custom command ID
  • In invoke, pass that command ID into runCommand
  • Tell the pty host and renderer shell integration addon that the next command with the matching command line is the ID we created

Originally posted by @Tyriar in #273175 (comment)

Metadata

Metadata

Labels

chat-terminalThe run in terminal tool in chatfeature-requestRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code Insiderson-testplan

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions