双击 select 文本 Windows 终端 select 只有一个字

Double-click to select text in Windows Terminal selects only one word

我正在尝试设置新的 Windows 终端以使用 git-bash。这是我当前的个人资料:

{
    "guid": "{00000000-0000-0000-ba54-000000000002}",
    "tabTitle": "Git Bash",
    "copyOnSelect": true,
    "acrylicOpacity" : 0.75,
    "closeOnExit" : true,
    "colorScheme" : "Campbell",
    "commandline" : "\"%PROGRAMFILES%\git\bin\bash.exe\" --login -i -l",
    "cursorColor" : "#FFFFFF",
    "cursorShape" : "bar",
    "fontFace" : "Consolas",
    "fontSize" : 12,
    "historySize" : 9001,           
    "name" : "Git Bash",
    "padding" : "0, 0, 0, 0",
    "snapOnInput" : true,
    "startingDirectory" : "C:\git",
    "useAcrylic" : false,
    "wordDelimiters": ":",
    "icon" : "%PROGRAMFILES%\git\mingw64\share\git\git-for-windows.ico"

使用 Windows 终端的一个小问题是,当 select 使用双击输入文本时,它只会 select 一个词,而不是一个词更智能 selection(就像一条完整的路径)。

我试过使用设置“wordDelimiters:”,设置如下:

`wordDelimiters: ":"` 

`wordDelimiters: "()'-:,.;<>~!@#$%^&*|+=[]{}~?"`

但它似乎对双击 select 编辑的文本没有任何影响。

我双击 'my' 时的预期行为是 select 整个路径(包括文件名)。相反,它只是 selects 'my'。 Path/to/my/file.txt

有谁知道如何让它工作,就像它在原生 git-bash 中一样?

wordDelimiters 设置放在 settings.json 文件的全局部分,而不是 "profiles" 数组中。我最终通过查看文件顶部的文档 link 弄明白了这一点,这可能是尝试添加新设置时查看的好地方。

// 有关这些设置的文档,请参阅:https://aka.ms/terminal-documentation