Show default cursor when alt is held in terminal

Fixes #44586
This commit is contained in:
Daniel Imms 2018-02-27 09:14:51 -08:00
parent 7201035735
commit b5c672d236
2 changed files with 11 additions and 0 deletions

View file

@ -100,6 +100,11 @@
text-decoration: underline;
}
/* Use the default cursor when alt is active to help with clicking to move cursor */
.monaco-workbench .panel.integrated-terminal .terminal-outer-container.alt-active .xterm {
cursor: default;
}
.monaco-workbench .panel.integrated-terminal .xterm {
position: absolute;
bottom: 0;

View file

@ -262,6 +262,12 @@ export class TerminalPanel extends Panel {
}
this._cancelContextMenu = false;
}));
this._register(dom.addDisposableListener(document, 'keydown', (event: KeyboardEvent) => {
this._terminalContainer.classList.toggle('alt-active', !!event.altKey);
}));
this._register(dom.addDisposableListener(document, 'keyup', (event: KeyboardEvent) => {
this._terminalContainer.classList.toggle('alt-active', !!event.altKey);
}));
this._register(dom.addDisposableListener(this._parentDomElement, 'keyup', (event: KeyboardEvent) => {
if (event.keyCode === 27) {
// Keep terminal open on escape