In progress: [Issue 6] Key bindings do not work under Linux
diff --git a/com.google.eclipse.terminal.local/plugin.xml b/com.google.eclipse.terminal.local/plugin.xml
index 9f19172..b67dea9 100644
--- a/com.google.eclipse.terminal.local/plugin.xml
+++ b/com.google.eclipse.terminal.local/plugin.xml
@@ -94,5 +94,36 @@
             commandId="com.google.eclipse.terminal.local.open">
       </handler>
    </extension>
+   <extension
+         point="org.eclipse.ui.contexts">
+      <context
+            description="In Local Terminal"
+            id="com.google.eclipse.terminal.local.localTerminalView"
+            name="Local Terminal"
+            parentId="org.eclipse.ui.contexts.window">
+      </context>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <category
+            id="com.google.eclipse.terminal.local.commands.category"
+            name="Local Terminal">
+      </category>
+      <command
+            categoryId="com.google.eclipse.terminal.local.commands.category"
+            id="com.google.eclipse.terminal.local.paste"
+            name="Paste">
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.bindings">
+      <key
+            commandId="com.google.eclipse.terminal.local.paste"
+            contextId="org.eclipse.ui.contexts.window"
+            platform="carbon"
+            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+            sequence="M1+V">
+      </key>
+   </extension>
 
 </plugin>
diff --git a/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/EditActions.java b/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/EditActions.java
deleted file mode 100644
index 1b9cb92..0000000
--- a/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/EditActions.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2012 Google Inc.
- *
- * All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse
- * Public License v1.0 which accompanies this distribution, and is available at
- *
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package com.google.eclipse.terminal.local.ui.view;
-
-import static org.eclipse.ui.actions.ActionFactory.*;
-
-import org.eclipse.jface.action.*;
-import org.eclipse.tm.internal.terminal.control.actions.*;
-import org.eclipse.tm.internal.terminal.emulator.VT100TerminalControl;
-import org.eclipse.ui.IActionBars;
-
-/**
- * @author alruiz@google.com (Alex Ruiz)
- */
-class EditActions {
-  private final AbstractTerminalAction copy;
-  private final AbstractTerminalAction paste;
-  private final AbstractTerminalAction clearAll;
-  private final AbstractTerminalAction selectAll;
-
-  EditActions(VT100TerminalControl terminalControl) {
-    copy = new TerminalActionCopy(terminalControl);
-    paste = new TerminalActionPaste(terminalControl);
-    clearAll = new TerminalActionClearAll(terminalControl);
-    selectAll = new TerminalActionSelectAll(terminalControl);
-  }
-
-  void addActionsTo(IMenuManager menuManager) {
-    menuManager.add(copy);
-    menuManager.add(paste);
-    menuManager.add(new Separator());
-    menuManager.add(clearAll);
-    menuManager.add(selectAll);
-  }
-
-  void update() {
-    update(copy, paste, clearAll, selectAll);
-  }
-
-  private void update(AbstractTerminalAction...actions) {
-    for (AbstractTerminalAction action : actions) {
-      action.updateAction(true);
-    }
-  }
-
-  void onMenuHidden() {
-    copy.updateAction(false);
-  }
-
-  void setUpGlobalActionHandlers(IActionBars actionBars) {
-    actionBars.setGlobalActionHandler(COPY.getId(), copy);
-    actionBars.setGlobalActionHandler(PASTE.getId(), paste);
-    actionBars.setGlobalActionHandler(SELECT_ALL.getId(), selectAll);
-  }
-}
\ No newline at end of file
diff --git a/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/PopupMenuFactory.java b/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/PopupMenuFactory.java
new file mode 100644
index 0000000..eb38bf7
--- /dev/null
+++ b/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/PopupMenuFactory.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2012 Google Inc.
+ *
+ * All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse
+ * Public License v1.0 which accompanies this distribution, and is available at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package com.google.eclipse.terminal.local.ui.view;
+
+import static org.eclipse.ui.actions.ActionFactory.*;
+
+import org.eclipse.jface.action.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.tm.internal.terminal.control.actions.*;
+import org.eclipse.tm.internal.terminal.emulator.VT100TerminalControl;
+import org.eclipse.ui.*;
+
+/**
+ * @author alruiz@google.com (Alex Ruiz)
+ */
+class PopupMenu {
+  private final AbstractTerminalAction copy;
+  private final AbstractTerminalAction paste;
+  private final AbstractTerminalAction selectAll;
+  private final AbstractTerminalAction clearAll;
+
+  PopupMenu(IViewSite viewSite, VT100TerminalControl terminalControl) {
+    PopupMenuManager menuManager = new PopupMenuManager();
+    copy = menuManager.add(new TerminalActionCopy(terminalControl));
+    paste = menuManager.add(new TerminalActionPaste(terminalControl));
+    menuManager.add(new Separator());
+    selectAll = menuManager.add(new TerminalActionSelectAll(terminalControl));
+    clearAll = menuManager.add(new TerminalActionClearAll(terminalControl));
+    IActionBars actionBars = viewSite.getActionBars();
+    actionBars.setGlobalActionHandler(COPY.getId(), copy);
+    actionBars.setGlobalActionHandler(PASTE.getId(), paste);
+    actionBars.setGlobalActionHandler(SELECT_ALL.getId(), selectAll);
+    paste.setActionDefinitionId("com.google.eclipse.terminal.local.paste");
+    IKeyBindingService keyBindingService = viewSite.getKeyBindingService();
+    keyBindingService.registerAction(paste);
+    menuManager.addMenuListener(new IMenuListener() {
+      @Override public void menuAboutToShow(IMenuManager manager) {
+        update(copy, paste, selectAll, clearAll);
+      }
+    });
+    Control control = terminalControl.getControl();
+    Menu menu = menuManager.createContextMenu(control);
+    control.setMenu(menu);
+    menu.addMenuListener(new MenuAdapter() {
+      @Override public void menuHidden(MenuEvent e) {
+        copy.updateAction(false);
+      }
+    });
+  }
+
+  void update() {
+    update(copy, paste, selectAll, clearAll);
+  }
+
+  private void update(AbstractTerminalAction...actions) {
+    for (AbstractTerminalAction action : actions) {
+      action.updateAction(true);
+    }
+  }
+
+  private static class PopupMenuManager extends MenuManager {
+    PopupMenuManager() {
+      super("#PopupMenu");
+    }
+
+    AbstractTerminalAction add(AbstractTerminalAction action) {
+      super.add(action);
+      return action;
+    }
+  }
+}
\ No newline at end of file
diff --git a/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/TerminalView.java b/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/TerminalView.java
index e361343..4175c61 100644
--- a/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/TerminalView.java
+++ b/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/TerminalView.java
@@ -25,7 +25,6 @@
 import org.eclipse.jface.action.*;
 import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.jface.util.*;
-import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.widgets.*;
 import org.eclipse.tm.internal.terminal.control.ITerminalListener;
@@ -94,7 +93,7 @@
   }
 
   @Override public void createPartControl(Composite parent) {
-    terminalWidget = new TerminalWidget(parent, SWT.NONE);
+    terminalWidget = new TerminalWidget(parent, getViewSite());
     terminalWidget.setLifeCycleListener(new LifeCycleListener() {
       @Override public void executionFinished() {
         closeViewOnExitIfPossible();
@@ -109,7 +108,6 @@
       }
     });
     IViewSite viewSite = getViewSite();
-    terminalWidget.setUpGlobalEditActionHandlers(viewSite.getActionBars());
     preferencesChangeListener = new AbstractPreferencesChangeListener() {
       @Override protected void onBufferLineCountChanged() {
         updateBufferLineCount();
diff --git a/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/TerminalWidget.java b/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/TerminalWidget.java
index 9b3e61a..ca77647 100644
--- a/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/TerminalWidget.java
+++ b/com.google.eclipse.terminal.local/src/com/google/eclipse/terminal/local/ui/view/TerminalWidget.java
@@ -12,15 +12,15 @@
 import static org.eclipse.tm.internal.terminal.provisional.api.TerminalState.CONNECTING;
 
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.action.*;
 import org.eclipse.jface.layout.*;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.*;
 import org.eclipse.swt.graphics.*;
 import org.eclipse.swt.widgets.*;
 import org.eclipse.tm.internal.terminal.control.ITerminalListener;
 import org.eclipse.tm.internal.terminal.emulator.VT100TerminalControl;
 import org.eclipse.tm.internal.terminal.provisional.api.*;
-import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IViewSite;
 
 import com.google.eclipse.terminal.local.core.connector.*;
 
@@ -31,12 +31,11 @@
   private final TerminalListener terminalListener = new TerminalListener();
 
   private final VT100TerminalControl terminalControl;
-  private final EditActions editActions;
 
   private LifeCycleListener lifeCycleListener;
 
-  TerminalWidget(Composite parent, int style) {
-    super(parent, style);
+  TerminalWidget(Composite parent, IViewSite viewSite) {
+    super(parent, SWT.NONE);
     GridLayoutFactory.fillDefaults().spacing(0, 0).applyTo(this);
     ITerminalConnector terminalConnector = createLocalTerminalConnector();
     terminalControl = new VT100TerminalControl(terminalListener, this, new ITerminalConnector[] { terminalConnector });
@@ -48,42 +47,18 @@
         disposeTerminalControl();
       }
     });
-    editActions = new EditActions(terminalControl);
-    MenuManager menuManager = new MenuManager("#PopupMenu");
-    editActions.addActionsTo(menuManager);
-    menuManager.addMenuListener(new IMenuListener() {
-      @Override public void menuAboutToShow(IMenuManager manager) {
-        editActions.update();
-      }
-    });
-    Menu menu = createContextMenu(menuManager);
-    menu.addMenuListener(new MenuAdapter() {
-      @Override public void menuHidden(MenuEvent e) {
-        editActions.onMenuHidden();
-      }
-    });
+    final PopupMenu popupMenu = new PopupMenu(viewSite, terminalControl);
     terminalTextControl().addFocusListener(new FocusAdapter() {
       @Override public void focusGained(FocusEvent e) {
-        editActions.update();
+        popupMenu.update();
       }
     });
   }
 
-  private Menu createContextMenu(MenuManager menuManager) {
-    Control control = terminalTextControl();
-    Menu menu = menuManager.createContextMenu(control);
-    control.setMenu(menu);
-    return menu;
-  }
-
   private Control terminalTextControl() {
     return terminalControl.getControl();
   }
 
-  void setUpGlobalEditActionHandlers(IActionBars actionBars) {
-    editActions.setUpGlobalActionHandlers(actionBars);
-  }
-
   void connect() {
     if (terminalControl.getState() == CONNECTING || terminalControl.isDisposed()) {
       return;