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

Allow extensions control dimensions for existing terminals #79246

Closed
IlyaBiryukov opened this issue Aug 15, 2019 · 6 comments
Closed

Allow extensions control dimensions for existing terminals #79246

IlyaBiryukov opened this issue Aug 15, 2019 · 6 comments
Assignees
Labels
api feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code terminal General terminal issues that don't fall under another label
Milestone

Comments

@IlyaBiryukov
Copy link

Live Share has a feature where when a user starts a collaboration session as a host, all existing terminals are automatically shared. When other guests join, they'll see these shared terminals.

The problem is that guests' UI dimensions are different from the host, and such shared terminals may not render correctly there.

Live Share already solves this for Pseudoterminal that users can create via Live Share viewlet. Live Share uses onDidOverrideDimensions and setDimensions on Pseudoterminal. It needs VSCode support for regular Terminal objects.

Existing terminals has read-only dimensions property on Terminal objects which we can use to get current terminal dimensions (maximum ones I assume), but nothing that we can use to change the dimensions, and no event that would tell us when UI changes and max dimensions change.

So the feature request is to expose onDidOverrideDimensions and setDimensions equivalent on Terminal objects that would allow to:

  1. Override current terminal dimensions
  2. Get current max dimensions as allowed by UI
  3. Know when max dimensions change (say when users resize UI).

cc @lostintangent, @Tyriar

@vscodebot
Copy link

vscodebot bot commented Aug 15, 2019

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

@Tyriar
Copy link
Member

Tyriar commented Aug 16, 2019

@IlyaBiryukov I remember chatting with you about this in the past, has this just never worked properly for Live Share?

@Tyriar Tyriar added api feature-request Request for new features or functionality terminal General terminal issues that don't fall under another label info-needed Issue requires more information from poster labels Aug 16, 2019
@Tyriar Tyriar added this to the Backlog milestone Aug 16, 2019
@IlyaBiryukov
Copy link
Author

@Tyriar it works for pseudoterminal-backed terminals that Live Share creates on its own. Pre-existing terminals, those that users create without Live Share, don't have means to change dimensions (the property is read-only) and there is no event to know when the max dimensions have changed due to UI changes. I don't think it ever worked for them.

@Tyriar
Copy link
Member

Tyriar commented Nov 29, 2019

there is no event to know when the max dimensions have changed due to UI changes

@IlyaBiryukov there is an event for this, the dimensions just can't be changed by extensions yet:

namespace window {
/**
* An event which fires when the [dimensions](#Terminal.dimensions) of the terminal change.
*/
export const onDidChangeTerminalDimensions: Event<TerminalDimensionsChangeEvent>;
}

@Tyriar Tyriar modified the milestones: Backlog, On Deck Apr 28, 2020
@Tyriar
Copy link
Member

Tyriar commented Apr 28, 2020

Proposal:

export interface Terminal {
	/**
	 * The current dimensions of the terminal. This will be `undefined` immediately after the
	 * terminal is created as the dimensions are not known until shortly after the terminal is
	 * created.
	 */
	readonly dimensions: ITerminalDimensions | undefined;

	// actualDimensions?
	// overrideDimensions?
	// setOverrideDimensions?
	overriddenDimensions: ITerminalDimensions | undefined;
}

export namespace window {
	/**
	 * An event which fires when the [dimensions](#Terminal.dimensions) of the terminal change.
	 */
	export const onDidChangeTerminalDimensions: Event<TerminalDimensionsChangeEvent>;
}

This uses similar language to the Pseudoterminal API where "dimensions" are the container dimensions and "override dimensions" are the actual terminal dimensions.

@Tyriar Tyriar modified the milestones: On Deck, Backlog Oct 11, 2021
@Tyriar Tyriar added the *out-of-scope Posted issue is not in scope of VS Code label Dec 16, 2024
@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2024
Copy link

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code terminal General terminal issues that don't fall under another label
Projects
None yet
Development

No branches or pull requests

3 participants