Skip to content

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

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

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

Conversation

@Vallabh-1504
Copy link
Contributor

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.

Demo

demo1.mp4

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 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.

X(bool, AllowVtChecksumReport, "compatibility.allowDECRQCRA", false) \
X(bool, AllowVtClipboardWrite, "compatibility.allowOSC52", true) \
X(bool, AllowKeypadMode, "compatibility.allowDECNKM", false) \
X(hstring, DragDropDelimiter, "dragDropDelimiter", L" ") \
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 new dragDropDelimiter setting lacks test coverage. The repository has comprehensive serialization tests in src/cascadia/UnitTests_SettingsModel/SerializationTests.cpp for profile settings. Consider adding a test case that verifies the setting can be properly serialized and deserialized, similar to how other profile settings are tested in the Profile() test method.

Copilot uses AI. Check for mistakes.
</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.
</data>
<data name="Profile_DragDropDelimiter.HelpText" xml:space="preserve">
<value>This text will be inserted between the paths of multiple files dropped into the terminal.</value>
<comment>A description for what the "drag drop delimiter" setting does.</comment>
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 closing tag for the data element. The opening tag on line 2728 is not properly closed before the next data element begins on line 2731. Add a closing </data> tag after line 2730.

Suggested change
<comment>A description for what the "drag drop delimiter" setting does.</comment>
<comment>A description for what the "drag drop delimiter" setting does.</comment>
</data>

Copilot uses AI. Check for mistakes.
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.
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

2 participants