11

I'm trying to setup the new Windows Terminal for using git-bash. This is my current profile:

{
    "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"

A bit of a show stopper for using the Windows Terminal is the fact that when selecting text using double-click it only selects one word, instead of a more intelligent selection (like a complete path).

I've tried using the setting "wordDelimiters:" with setting like:

`wordDelimiters: ":"` 

or

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

but it doesn't seem to have any affect on what text is selected on double-click.

Expected behaviour when I double-click on 'my' is that it select the whole path (file name included). Instead it just selects 'my'. Path/to/my/file.txt

Does anyone know how get this to work, like it does in native git-bash?

torsan
  • 281
  • 4
  • 13
  • 1
    Just to clarify. Put `"wordDelimiters": "()\"':,;<>!@#$%^&*|+=[]{}?│"` directly, not add with \` at the beginning and end. Also, the Escape character should be used as there is a `"` already. https://docs.microsoft.com/en-us/windows/terminal/customize-settings/global-settings – Zhilong Jia Jan 14 '21 at 13:05

1 Answers1

20

Put the wordDelimiters setting in the global section of your settings.json file, not within the "profiles" array. I finally figured this out by looking at the documentation link at the top of the file, it is probably a good place to look when trying to add new settings.

// For documentation on these settings, see: https://aka.ms/terminal-documentation

enter image description here

JohnD
  • 13,062
  • 4
  • 33
  • 50
  • 1
    The docs refer to "profiles.json", but upon selecting Settings from the Microsoft Terminal dropdown, it file is actually "settings.json". – Bill Hoag Jun 11 '20 at 20:12
  • Thanks Bill, looks like they renamed the file so I'll update the answer – JohnD Jun 12 '20 at 13:39