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

Expose API whether shell integration is working or not #205058

Closed
Tracked by #22879
karrtikr opened this issue Feb 13, 2024 · 2 comments
Closed
Tracked by #22879

Expose API whether shell integration is working or not #205058

karrtikr opened this issue Feb 13, 2024 · 2 comments
Assignees
Labels
api api-proposal *duplicate Issue identified as a duplicate of another issue(s) terminal-shell-integration Shell integration, command decorations, etc.
Milestone

Comments

@karrtikr
Copy link
Contributor

We've been trying to figure out for ourselves using various means whether shell integration is working or not:

  • Using terminal data write event
  • Using terminal command event

Unfortunately each of them have not been reliably working for our users, resulting in various bug reports.

We need this information to use collection.prepend functionality correctly, to make sure we prepend exactly "once". Couple of solutions we could go with:

  • Change behavior of collection.prepend internally to make sure we prepend exactly once even when applyAtShellIntegration and applyAtProcessCreation both are true.
  • Expose an API to reliably tell extensions whether shell integration is working.
@Tyriar
Copy link
Member

Tyriar commented Mar 8, 2024

This is what I'm thinking here:

	export interface TerminalState {
		/**
		 * Whether the {@link Terminal} has had [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration)
		 * activated. This typically happens shortly after the terminal has been created.
		 */
		readonly isShellIntegrationActivated: boolean;
	}

This uses the existing TerminalState and event to expose it. This would make sense to implement with #145234 as it also introduces shell integration-related APIs.

Note that this is set per Terminal and there isn't a global "is shell integration on" by design as terminals can be very different from each other.

@Tyriar Tyriar added feature-request Request for new features or functionality api api-proposal terminal-shell-integration Shell integration, command decorations, etc. labels Mar 8, 2024
@Tyriar Tyriar added this to the March 2024 milestone Mar 8, 2024
Tyriar added a commit that referenced this issue Mar 8, 2024
This is not protected to only proposed extensions, not clear how
to do it easily for a property.

Part of #205058
@Tyriar
Copy link
Member

Tyriar commented Mar 12, 2024

Merging this request into #145234 as they're so closely related and influence each other.

@Tyriar Tyriar closed this as completed Mar 12, 2024
@Tyriar Tyriar added the *duplicate Issue identified as a duplicate of another issue(s) label Mar 12, 2024
@Tyriar Tyriar removed the feature-request Request for new features or functionality label Mar 22, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api api-proposal *duplicate Issue identified as a duplicate of another issue(s) terminal-shell-integration Shell integration, command decorations, etc.
Projects
None yet
Development

No branches or pull requests

2 participants