Skip to content

Terminal resizing does not take position into account #140873

@jmg-duarte

Description

@jmg-duarte

As the title states, the resize action does not take into account the position of the terminal.

If the terminal is on the left, I would expect the resizePaneLeft action to enlarge the terminal, etc.

Example:
2022-01-17 20-41-20

registerAction2(class extends Action2 {
constructor() {
super({
id: TerminalCommandId.ResizePaneLeft,
title: { value: localize('workbench.action.terminal.resizePaneLeft', "Resize Terminal Left"), original: 'Resize Terminal Left' },
f1: true,
category,
keybinding: {
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.LeftArrow },
mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.LeftArrow },
when: TerminalContextKeys.focus,
weight: KeybindingWeight.WorkbenchContrib
},
precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated)
});
}
async run(accessor: ServicesAccessor) {
accessor.get(ITerminalGroupService).activeGroup?.resizePane(Direction.Left);
}
});
registerAction2(class extends Action2 {
constructor() {
super({
id: TerminalCommandId.ResizePaneRight,
title: { value: localize('workbench.action.terminal.resizePaneRight', "Resize Terminal Right"), original: 'Resize Terminal Right' },
f1: true,
category,
keybinding: {
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.RightArrow },
mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.RightArrow },
when: TerminalContextKeys.focus,
weight: KeybindingWeight.WorkbenchContrib
},
precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated)
});
}
async run(accessor: ServicesAccessor) {
accessor.get(ITerminalGroupService).activeGroup?.resizePane(Direction.Right);
}
});

I did a quick dive into the code and think that it could be easily added if the terminal position is available in the snippet above.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code Insidersterminal-layoutIssue relating to resizing, scroll bar position, terminal dimensions, etc.verifiedVerification succeeded

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions