X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=src%2Fxterm.js;h=5aa069e796c688b291265b60ae1d1920291a772c;hb=106eda70675296907643782358134d2628872ca4;hp=d4cb00158c776e2933038d27b187fd041752e7cb;hpb=72e85a352af446171fd62a5c8e3b349375d60c66;p=mirror_xterm.js.git diff --git a/src/xterm.js b/src/xterm.js index d4cb001..5aa069e 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -429,7 +429,7 @@ Terminal.prototype.setOption = function(key, value) { switch (key) { case 'cursorBlink': this.setCursorBlinking(value); break; case 'cursorStyle': - // Style 'block' applies with no class + this.element.classList.toggle(`xterm-cursor-style-block`, value === 'block'); this.element.classList.toggle(`xterm-cursor-style-underline`, value === 'underline'); this.element.classList.toggle(`xterm-cursor-style-bar`, value === 'bar'); break; @@ -639,6 +639,7 @@ Terminal.prototype.open = function(parent, focus) { this.element.classList.add('terminal'); this.element.classList.add('xterm'); this.element.classList.add('xterm-theme-' + this.theme); + this.element.classList.add(`xterm-cursor-style-${this.options.cursorStyle}`); this.setCursorBlinking(this.options.cursorBlink); this.element.setAttribute('tabindex', 0); @@ -1016,7 +1017,10 @@ Terminal.prototype.bindMouse = function() { } on(el, 'mousedown', function(ev) { - // ensure focus + + // Prevent the focus on the textarea from getting lost + // and make sure we get focused on mousedown + ev.preventDefault(); self.focus(); if (!self.mouseEvents) return;