Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 362
torsan Avatar asked Feb 27 '20 20:02

torsan


People also ask

How do I select all text in terminal windows?

The feature of select-all via Ctrl + A is arriving soon also in Windows Terminal. This feature was opened in the post Ability to select/copy all the text in the session #1469 and was assigned to the developer Carlos Zamora.

How do you copy text in Windows Terminal?

You may copy this selection using either right-click “Copy” or Ctrl + C , whichever you find easier. Use the approved keyboard shortcut Ctrl + Shift + V to paste the text inside the terminal. You can also paste using a right-click.


1 Answers

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

like image 136
JohnD Avatar answered Oct 19 '22 05:10

JohnD