Skip to content

Add setting for customizable delimiter for file drag-and-drop#19799

Open
Vallabh-1504 wants to merge 2 commits intomicrosoft:mainfrom
Vallabh-1504:configure-delimiter
Open

Add setting for customizable delimiter for file drag-and-drop#19799
Vallabh-1504 wants to merge 2 commits intomicrosoft:mainfrom
Vallabh-1504:configure-delimiter

Conversation

@Vallabh-1504
Copy link
Contributor

@Vallabh-1504 Vallabh-1504 commented Jan 27, 2026

Summary of the Pull Request

This PR introduces a new profile setting, dragDropDelimiter, which allows users to configure the string separator used when dragging and dropping multiple files into the terminal. The default behavior remains a single space (" ") for backward compatibility.

References and Relevant Issues

Detailed Description of the Pull Request / Additional comments

Implementation Details:

  • Settings: Added DragDropDelimiter to MTSMSettings.h and Profile.idl.
  • Control: Wired the setting through ControlProperties.h so the terminal logic can see it.
  • Logic: Updated TermControl::OnDrop to use the new delimiter when joining paths.
  • UI: Added the text box in the Advanced Settings page and updated the ViewModel.

Validation Steps Performed

  • Manual Verification:
    • Verified default behavior (space separator) works as before.
    • Configured dragDropDelimiter to ", ", ";", and custom strings in settings.json and from settings UI.
    • Confirmed dropped files are joined correctly.
  • Build: Validated that the solution builds cleanly.

Notes for Reviewers

  1. Delimiter Length: Currently, there is no limit on the maximum length of the delimiter string. Let me know if this should be changed.
  2. Localization: I changed only Resources/en-US file.
  3. ViewModel: In ProfileViewModel.cpp, I added the else if block for the new setting, but left it empty because no other UI logic currently depends on it.

PR Checklist

@Vallabh-1504 Vallabh-1504 force-pushed the configure-delimiter branch 2 times, most recently from 21e4b1a to fb30903 Compare January 27, 2026 17:55
@Vallabh-1504 Vallabh-1504 changed the title Feature: Add setting for customizable delimiter for file drag-and-drop Add setting for customizable delimiter for file drag-and-drop Feb 15, 2026
Copilot AI review requested due to automatic review settings February 27, 2026 15:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new profile setting dragDropDelimiter that allows users to customize the delimiter used when dragging and dropping multiple files into the terminal. The default delimiter remains a single space for backward compatibility, but users can now configure it to use comma-space, semicolon, or any custom string to match their shell's syntax requirements (e.g., PowerShell's comma-separated paths).

Changes:

  • Added dragDropDelimiter profile setting to the settings model, control properties, and UI with a default value of " " (single space)
  • Updated drag-and-drop logic in TermControl to use the configurable delimiter instead of hardcoded space
  • Added settings UI in the Advanced tab with localized strings for the delimiter configuration

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/cascadia/TerminalSettingsModel/MTSMSettings.h Added dragDropDelimiter to profile settings macro with default value L" "
src/cascadia/TerminalSettingsModel/Profile.idl Added DragDropDelimiter as inheritable profile setting
src/cascadia/inc/ControlProperties.h Added DragDropDelimiter to control properties macro
src/cascadia/TerminalControl/IControlSettings.idl Exposed DragDropDelimiter getter in control settings interface
src/cascadia/TerminalControl/TermControl.cpp Updated file drop logic to use configurable delimiter instead of hardcoded space
src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl Added DragDropDelimiter to observable projected profile settings
src/cascadia/TerminalSettingsEditor/ProfileViewModel.h Added macro entry for DragDropDelimiter observable setting
src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp Added empty property change handler (unnecessary code added)
src/cascadia/TerminalSettingsEditor/Profiles_Advanced.xaml Added TextBox UI control for drag/drop delimiter configuration
src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.cpp Initialized DragDropDelimiter from profile settings
src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw Added localized strings with critical XML syntax error (missing closing tag)
doc/cascadia/profiles.schema.json Added dragDropDelimiter schema entry with type string and default value

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

</local:SettingContainer>

<!-- Drag Drop Delimiter -->
<local:SettingContainer x:Uid="Profile_DragDropDelimiter"
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing x:Name attribute on the SettingContainer. All other SettingContainer elements in this file have x:Name attributes for consistency (e.g., "ShowMarks", "RainbowSuggestions", "PathTranslationStyle"). Add x:Name="DragDropDelimiter" to line 276.

Suggested change
<local:SettingContainer x:Uid="Profile_DragDropDelimiter"
<local:SettingContainer x:Name="DragDropDelimiter"
x:Uid="Profile_DragDropDelimiter"

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to this change. We use x:Name to populate the search index.

Comment on lines +109 to +113
else if (viewModelProperty == L"DragDropDelimiter")
{
// No specific computed property depends on this
// we can add _NotifyChanges(), if required
}
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty else-if block is unnecessary. Settings that don't have derived properties don't need handlers in the PropertyChanged event. Consider removing this entire else-if block (lines 109-113) to reduce clutter. Many other simple settings like AllowVtClipboardWrite, RainbowSuggestions, etc. don't have handlers here.

Suggested change
else if (viewModelProperty == L"DragDropDelimiter")
{
// No specific computed property depends on this
// we can add _NotifyChanges(), if required
}

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to this change. No need for an empty branch like that. Please remove it.

@Vallabh-1504 Vallabh-1504 force-pushed the configure-delimiter branch from 370f6b9 to 6e744cb Compare March 9, 2026 12:17
@Vallabh-1504
Copy link
Contributor Author

Hi, could someone review this PR?
It’s been open for a while now.

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there! Sorry for the delay reviewing this. There's just a few minor changes I want to see before approving. Nice work and thanks for doing this 😊.

EDIT: Oh! Can you also update the documentation please? You'll want to submit a PR for this page here: https://github.com/MicrosoftDocs/terminal/blob/main/TerminalDocs/customize-settings/profile-advanced.md

</local:SettingContainer>

<!-- Drag Drop Delimiter -->
<local:SettingContainer x:Uid="Profile_DragDropDelimiter"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to this change. We use x:Name to populate the search index.

Comment on lines +109 to +113
else if (viewModelProperty == L"DragDropDelimiter")
{
// No specific computed property depends on this
// we can add _NotifyChanges(), if required
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to this change. No need for an empty branch like that. Please remove it.

<value>Yes, clear the cache</value>
</data>
<data name="Profile_DragDropDelimiter.Header" xml:space="preserve">
<value>Drag/Drop delimiter</value>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<value>Drag/Drop delimiter</value>
<value>Drag and drop delimiter</value>

"Drag and drop" seems to be the main way this feature is referred to, so we should be consistent with that.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Mar 10, 2026
@carlos-zamora
Copy link
Member

Extracted from PR body:

Demo

demo1.mp4

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Mar 17, 2026
@Vallabh-1504
Copy link
Contributor Author

Hi @carlos-zamora, thanks for reviewing!
I have made the changes as requested.
I also updated the comment in TermControl.cpp for new behavior.

will open a separate PR to update the documentation for this feature as soon as I have some time to work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configurable delimiter when drag-and-drop multiple files

3 participants