Skip to content

Commit

Permalink
Don't action right click when target is scroll bar
Browse files Browse the repository at this point in the history
Fixes #223358
  • Loading branch information
Tyriar committed Jul 26, 2024
1 parent c47678c commit 9a02ce1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/vs/workbench/contrib/terminal/browser/terminalEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ export class TerminalEditor extends EditorPane {
}
this._register(dom.addDisposableListener(this._editorInstanceElement, 'mousedown', async (event: MouseEvent) => {
const terminal = this._terminalEditorService.activeInstance;
if (this._terminalEditorService.instances.length === 0 || !terminal) {
if (
this._terminalEditorService.instances.length === 0 ||
!terminal ||
dom.isHTMLElement(event.target) && event.target.classList.contains('scrollbar')
) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ export class TerminalTabbedView extends Disposable {
}));
this._register(dom.addDisposableListener(terminalContainer, 'mousedown', async (event: MouseEvent) => {
const terminal = this._terminalGroupService.activeInstance;
if (this._terminalGroupService.instances.length === 0 || !terminal) {
if (
this._terminalGroupService.instances.length === 0 ||
!terminal ||
dom.isHTMLElement(event.target) && event.target.classList.contains('scrollbar')
) {
this._cancelContextMenu = true;
return;
}
Expand Down

0 comments on commit 9a02ce1

Please sign in to comment.