microsoft / microsoft/terminal

Click-and-drag does not cause search field to lose focus

Open
#17,539 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-TerminalControl Issue-Bug Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version

1.20.11781.0

### Windows build number

10.0.19045.4529

### Other Software

_No response_

### Steps to reproduce

Settings:
- "Automatically copy selection to clipboard" (`copyOnSelect`): false
- "Automatically focus pane on mouse hover" (`focusFollowMouse`): false

Steps:
1. Echo some arbitrary text on the console
(not needed if for example PowerShell automatically printed its version; or the current working directory)
2. Open the search: Ctrl + Shift + F
3. Click-and-drag to select any of the output from step 1
ℹ️ Note: Do not perform a separate left click; instead press down the mouse button and directly start dragging your mouse
4. Try for example to copy the selection with Ctrl + C

### Expected Behavior

Step 3: The search text field lost focus; the console output got focus
Step 4: You copied your selection to the clipboard

### Actual Behavior

Step 3: A text selection is shown for the console output, _but_ the search text field still has focus
Step 4: You did not copy anything because the search text field still has focus

Side note: If instead of click-and-drag you perform a separate click (press and release) first, then the console output properly has focus.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in Windows Terminal with copyOnSelect and focusFollowMouse disabled, using the listed click-and-drag steps. Then trace the mouse-drag and focus handling for the search field and console output. Done means dragging directly transfers focus so Ctrl+C copies the selected console text.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.