onDidOverrideDimensions property

Event<TerminalDimensions?>? get onDidOverrideDimensions

An event that when fired allows overriding the {@link Pseudoterminal.setDimensions dimensions} of the terminal. Note that when set, the overridden dimensions will only take effect when they are lower than the actual dimensions of the terminal (ie. there will never be a scroll bar). Set to undefined for the terminal to go back to the regular dimensions (fit to the size of the panel).

Events fired before {@link Pseudoterminal.open} is called will be be ignored.

Example: Override the dimensions of a terminal to 20 columns and 10 rows

const dimensionsEmitter = new vscode.EventEmitter<vscode.TerminalDimensions>();
const pty: vscode.Pseudoterminal = {
  onDidWrite: writeEmitter.event,
  onDidOverrideDimensions: dimensionsEmitter.event,
  open: () => {
    dimensionsEmitter.fire({
      columns: 20,
      rows: 10
    });
  },
  close: () => {}
};
vscode.window.createTerminal({ name: 'My terminal', pty });

Implementation

_i3.Event<_i3.TerminalDimensions?>? get onDidOverrideDimensions =>
    _i5.getProperty(
      this,
      'onDidOverrideDimensions',
    );
set onDidOverrideDimensions (Event<TerminalDimensions?>? value)

Implementation

set onDidOverrideDimensions(_i3.Event<_i3.TerminalDimensions?>? value) {
  _i5.setProperty(
    this,
    'onDidOverrideDimensions',
    value ?? _i6.undefined,
  );
}