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

Creating multiple output channels by the same name results in an inability to select all but the last one #49186

Closed
TomasHubelbauer opened this issue May 4, 2018 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug output Output channel system issues
Milestone

Comments

@TomasHubelbauer
Copy link
Contributor

  • VSCode Version: 1.23.0

Steps to Reproduce:

Create an extension which does this in its activate method:

const chan1 = window.createOutputChannel('Rustup');
chan1.show();
chan1.appendLine('Channel 1');
const chan2 = window.createOutputChannel('Rustup');
chan2.show();
chan2.appendLine('Channel 2');

Once started up, the extension creates two output channels with the same name (without a warning or a runtime error). The latter channel is shown and the output channel switcher doesn't allow selecting the former one, it always switches to the latter one.

There is a couple of ways this could be fixed:

  1. Throw a runtime error while trying to open up a channel with the same name again (this is risky as multiple extensions can create the same channel name and I don't know if VS Code prefixes the channel names internally or if this would open up a way to crash another extension).

  2. Show already existing channel by the given name. This is my preference as it would make it simple to create channels on demand and just call createOutputChannel each time without having to keep track of whether the channel is already created. There is no API for enumerating (even own) channels, so this would be a behaviour that much nicer.

@vscodebot vscodebot bot added the new release label May 4, 2018
@vscodebot
Copy link

vscodebot bot commented May 4, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@TomasHubelbauer
Copy link
Contributor Author

TomasHubelbauer commented May 4, 2018

In terms of @vscodebot's suggestions:

@sandy081 sandy081 added output Output channel system issues bug Issue identified by VS Code Team member as probable bug and removed new release labels May 7, 2018
@sandy081 sandy081 added this to the Backlog milestone May 7, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug output Output channel system issues
Projects
None yet
Development

No branches or pull requests

2 participants