src/vs/workbench/contrib/terminal/browser/terminalContextMenu.ts/openContextMenu
export function openContextMenu(event: MouseEvent, parent: HTMLElement, menu: IMenu, contextMenuService: IContextMenuService, extraActions?: Action[]): void {
	const standardEvent = new StandardMouseEvent(event);

	const anchor: { x: number; y: number } = { x: standardEvent.posx, y: standardEvent.posy };
	const actions: IAction[] = [];

	const actionsDisposable = createAndFillInContextMenuActions(menu, undefined, actions);

	if (extraActions) {
		actions.push(...extraActions);
	}

	contextMenuService.showContextMenu({
		getAnchor: () => anchor,
		getActions: () => actions,
		getActionsContext: () => parent,
		onHide: () => actionsDisposable.dispose()
	});
}