浏览代码

Support macOptionIsMeta option in terminal. fixes #4236

Atsuo Ishimoto 4 年之前
父节点
当前提交
3484ceba25
共有 2 个文件被更改,包括 16 次插入1 次删除
  1. 9 0
      packages/terminal-extension/schema/plugin.json
  2. 7 1
      packages/terminal/src/tokens.ts

+ 9 - 0
packages/terminal-extension/schema/plugin.json

@@ -24,6 +24,9 @@
     },
     "pasteWithCtrlV": {
       "type": "boolean"
+    },
+    "macOptionIsMeta": {
+      "type": "boolean"
     }
   },
   "properties": {
@@ -74,6 +77,12 @@
       "description": "Enable pasting with Ctrl+V.  This can be disabled to use Ctrl+V in the vi editor, for instance.  This setting has no effect on macOS, where Cmd+V is available",
       "type": "boolean",
       "default": true
+    },
+    "macOptionIsMeta": {
+      "title": "Treat option as meta key on macOS",
+      "description": "Option key on macOS can be used as meta key. This enables to use shortcuts such as option + f to move cursor forward one word",
+      "type": "boolean",
+      "default": false
     }
   },
   "additionalProperties": false,

+ 7 - 1
packages/terminal/src/tokens.ts

@@ -111,6 +111,11 @@ export namespace ITerminal {
      * Whether to auto-fit the terminal to its host element size.
      */
     autoFit?: boolean;
+
+    /**
+     * Treat option as meta key on macOS.
+     */
+    macOptionIsMeta: boolean;
   }
 
   /**
@@ -127,7 +132,8 @@ export namespace ITerminal {
     initialCommand: '',
     screenReaderMode: false, // False by default, can cause scrollbar mouse interaction issues.
     pasteWithCtrlV: true,
-    autoFit: true
+    autoFit: true,
+    macOptionIsMeta: false
   };
 
   /**