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

API to retrieve a dimensions from a given Terminal instance #55718

Open
alpaix opened this issue Aug 3, 2018 · 8 comments · Fixed by #67919
Open

API to retrieve a dimensions from a given Terminal instance #55718

alpaix opened this issue Aug 3, 2018 · 8 comments · Fixed by #67919
Assignees
Labels
api api-finalization feature-request Request for new features or functionality terminal-layout Issue relating to resizing, scroll bar position, terminal dimensions, etc.
Milestone

Comments

@alpaix
Copy link

alpaix commented Aug 3, 2018

VS Live Share extension needs to know current dimensions of a terminal and also to get notified when they're getting changed.

Consider adding a new API to get read-only access to a terminal renderer associated with given terminal instance.

@vscodebot vscodebot bot added the terminal General terminal issues that don't fall under another label label Aug 3, 2018
@Tyriar
Copy link
Member

Tyriar commented Aug 3, 2018

Would exposing this would also solve the issue?

export interface TerminalRenderer {
		dimensions: TerminalDimensions | undefined;

		readonly onDidChangeDimensions: Event<TerminalDimensions>;
}

@Tyriar Tyriar added info-needed Issue requires more information from poster api labels Aug 3, 2018
@alpaix
Copy link
Author

alpaix commented Aug 3, 2018

@Tyriar Yes. That'd solve it. In addition to that we need a method to get a renderer instance:

    vscode.window.onDidOpenTerminal(async terminal => {
        // HOW to get a renderer instance out of the terminal?
        const render = terminal.renderer;
        renderer.onDidChangeDimensions(d => {  });
        await this.terminalProvider.shareTerminal(terminal, this.trace);
    });

@Tyriar
Copy link
Member

Tyriar commented Aug 3, 2018

Opps, copy and paste mistake above, I mean adding those properties on Terminal, not TerminalRenderer:

export interface Terminal {
		dimensions: TerminalDimensions;

		readonly onDidChangeDimensions: Event<TerminalDimensions>;
}

@alpaix
Copy link
Author

alpaix commented Aug 3, 2018

Sure. That'd be sufficient to meet our needs!

@Tyriar Tyriar added this to the August 2018 milestone Aug 6, 2018
@Tyriar Tyriar added feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Aug 6, 2018
@Tyriar Tyriar changed the title API to retrieve a TerminalRenderer given a Terminal instance API to retrieve a dimensions from a given Terminal instance Aug 24, 2018
@Tyriar Tyriar modified the milestones: August 2018, September 2018 Aug 27, 2018
@Tyriar Tyriar modified the milestones: September 2018, October 2018 Sep 24, 2018
@Tyriar Tyriar modified the milestones: October 2018, November 2018 Oct 25, 2018
@Tyriar Tyriar modified the milestones: November 2018, December 2018 Dec 3, 2018
Tyriar added a commit that referenced this issue Feb 5, 2019
@octref octref added the verification-needed Verification of issue is requested label Feb 25, 2019
@alexr00 alexr00 added the verification-found Issue verification failed label Feb 26, 2019
@alexr00
Copy link
Member

alexr00 commented Feb 26, 2019

This API is still in proposed.

@alexr00 alexr00 reopened this Feb 26, 2019
@Tyriar
Copy link
Member

Tyriar commented Feb 26, 2019

I didn't actually want this verified, it will be looked at with #58660

@Tyriar Tyriar closed this as completed Feb 26, 2019
@Tyriar Tyriar removed verification-found Issue verification failed verification-needed Verification of issue is requested feature-request Request for new features or functionality labels Feb 26, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 12, 2019
@Tyriar Tyriar added the feature-request Request for new features or functionality label Nov 29, 2019
@Tyriar Tyriar reopened this Nov 29, 2019
@Tyriar Tyriar modified the milestones: February 2019, On Deck Nov 29, 2019
@Tyriar
Copy link
Member

Tyriar commented Nov 29, 2019

Related: #79246

@Tyriar
Copy link
Member

Tyriar commented Nov 29, 2019

AFAIK this API isn't being used yet as #79246 is needed.

//#region Terminal dimensions property and change event https://github.com/microsoft/vscode/issues/55718
/**
* An [event](#Event) which fires when a [Terminal](#Terminal)'s dimensions change.
*/
export interface TerminalDimensionsChangeEvent {
/**
* The [terminal](#Terminal) for which the dimensions have changed.
*/
readonly terminal: Terminal;
/**
* The new value for the [terminal's dimensions](#Terminal.dimensions).
*/
readonly dimensions: TerminalDimensions;
}
namespace window {
/**
* An event which fires when the [dimensions](#Terminal.dimensions) of the terminal change.
*/
export const onDidChangeTerminalDimensions: Event<TerminalDimensionsChangeEvent>;
}
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: TerminalDimensions | undefined;
}
//#endregion

cc @IlyaBiryukov

@Tyriar Tyriar modified the milestones: On Deck, Backlog Aug 27, 2021
@Tyriar Tyriar added terminal-layout Issue relating to resizing, scroll bar position, terminal dimensions, etc. and removed terminal General terminal issues that don't fall under another label labels Dec 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api api-finalization feature-request Request for new features or functionality terminal-layout Issue relating to resizing, scroll bar position, terminal dimensions, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants