title: Xtermjs can not copy & paste
body: <p>I was not able to implement the copy &amp; paste function from xterm.js APIs. I want the terminal to be able to copy strings from the clipboard. </p>
  
  <p>I'm using </p>
  
  <pre><code>  this.term.onKey((key) =&gt; {
      if (key.domEvent.code === 'KeyC'){
       if (key.domEvent.ctrlKey) {
       this.copiedText = this.term.getSelection();
      }
     } else if (key.domEvent.code === 'KeyV'){
       if (key.domEvent.ctrlKey) {
       this.term.write(this.copiedText);
      } 
     }
    }
  </code></pre>
  
  <p>but it can only get copied text within the terminal and the key event can not detect the command key on MAC (right now I'm using ctl + c &amp; ctl + v)</p>
  
  <p>If I use the onData(), the event is triggered when I press command + V and I can see it outputs strings ouside the terminal</p>
  
  <pre><code>  this.term.onData((data) =&gt; {
      console.log(data.toString());  // prints "strings I copied with command + c"
    });
  </code></pre>
  
  <p>But "data" is just a string and the event is triggered by key press as well, so term.onData will conflict with onKey() event, and I'm not sure how to set a condition on "data" since it is not a object.</p>