]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Fix Ctrl+Shift+V pasting
authorTDaglis <ath.daglis@gmail.com>
Thu, 30 Jun 2016 07:58:00 +0000 (10:58 +0300)
committerTDaglis <ath.daglis@gmail.com>
Thu, 30 Jun 2016 07:58:00 +0000 (10:58 +0300)
src/xterm.js

index 51357afbd5699a5da78b72da6274c2f588aa07a7..77040281ec350dd8b26520096c150397d2eed370 100644 (file)
 
       /**
        * Hack pasting with keyboard, in order to make it work without contentEditable.
-       * When a user types Ctrl + Shift + V or Cmd + V on a Mac, lease the contentEditable value
-       * as true.
+       * When a user types Ctrl + Shift + V or Shift + Insert on a non Mac or Cmd + V on a Mac,
+       * lease the contentEditable value as true.
        */
       on(term.element, 'keydown', function (ev) {
         var isEditable = term.element.contentEditable === "true";
           term.leaseContentEditable(5000);
         }
 
-        if (!term.isMac && ev.keyCode == 45 && ev.shiftKey && !ev.ctrlKey && !isEditable) {
-          // Shift + Insert pastes on windows and many linuxes
-          term.leaseContentEditable();
+        if (!term.isMac && !isEditable) {
+          if ((ev.keyCode == 45 && ev.shiftKey && !ev.ctrlKey) ||  // Shift + Insert
+              (ev.keyCode == 86 && ev.shiftKey && ev.ctrlKey)) {  // Ctrl + Shict + V
+            term.leaseContentEditable();
+          }
         }
       });
 
                   // insert combining char in last cell
                   // FIXME: needs handling after cursor jumps
                   if (!ch_width && this.x) {
-                    
+
                     // dont overflow left
                     if (this.lines[this.y + this.ybase][this.x-1]) {
                       if (!this.lines[this.y + this.ybase][this.x-1][2]) {