Limit triple-click selection to command field only #13529

Open
opened 2026-01-31 03:45:07 +00:00 by claunia · 4 comments
Owner

Originally created by @SpitFire-666 on GitHub (Apr 18, 2021).

Description of the new feature/enhancement

Currently, Ctrl+A will select the entire command/text input, however, triple clicking (mouse version of Select All selects the entire line (including the prompt). GIF shows selecting with mouse vs with keyboard:

terminal

I can't think of many (any?) situations where I'd want to include the prompt when selecting or copying a line.

Proposed technical implementation details (optional)

I would like the triple click action to align to the Ctrl+A selection method. Thanks!

Originally created by @SpitFire-666 on GitHub (Apr 18, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Currently, Ctrl+A will select the entire command/text input, however, triple clicking (mouse version of Select All selects the entire line (including the prompt). GIF shows selecting with mouse vs with keyboard: ![terminal](https://user-images.githubusercontent.com/38451588/115137957-7c76ba80-a06c-11eb-9201-c1ab5e9ec4a7.gif) I can't think of many (any?) situations where I'd want to include the prompt when selecting or copying a line. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. --> I would like the triple click action to align to the Ctrl+A selection method. Thanks!
claunia added the Issue-TaskArea-InputProduct-TerminalArea-TerminalControl labels 2026-01-31 03:45:07 +00:00
Author
Owner

@LuanVSO commented on GitHub (Apr 19, 2021):

the ctrl+a selection is handled by PowerShell while the triple click is handed by terminal.
there's no way for terminal to have the same behavior because it doesn't know where the prompt is or even if there is a prompt in the screen

@LuanVSO commented on GitHub (Apr 19, 2021): the ctrl+a selection is handled by PowerShell while the triple click is handed by terminal. there's no way for terminal to have the same behavior because it doesn't know where the prompt is or even if there is a prompt in the screen
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Apr 19, 2021):

Shells could be configured to emit FTCS_COMMAND_START from Proprietary Escape Codes of iTerm2, and Windows Terminal could then use that to avoid selecting the prompt. The same marking of prompts would be used in https://github.com/microsoft/terminal/issues/6232.

I think cmd.exe and PowerShell already let users embed ESC characters in prompts, so these shells would not have to be changed. Not so sure about Windows PowerShell though.

@KalleOlaviNiemitalo commented on GitHub (Apr 19, 2021): Shells could be configured to emit FTCS_COMMAND_START from [Proprietary Escape Codes](https://iterm2.com/documentation-escape-codes.html) of iTerm2, and Windows Terminal could then use that to avoid selecting the prompt. The same marking of prompts would be used in <https://github.com/microsoft/terminal/issues/6232>. I think cmd.exe and PowerShell already let users embed ESC characters in prompts, so these shells would not have to be changed. Not so sure about Windows PowerShell though.
Author
Owner

@zadjii-msft commented on GitHub (Apr 19, 2021):

Huh. Okay, the FTCS_COMMAND_START solution is clever. This would then also require #1553, and some way of setting triple click to "select the whole line up to the prompt (if one exists)". So I guess I'll toss this in on #1553

@zadjii-msft commented on GitHub (Apr 19, 2021): Huh. Okay, the FTCS_COMMAND_START solution is clever. This would then also require #1553, and some way of setting triple click to "select the whole line up to the prompt (if one exists)". So I guess I'll toss this in on #1553
Author
Owner

@zadjii-msft commented on GitHub (Jul 20, 2023):

I am TEMPTED to axe this, in favor of the experimental.rightClickContextMenu (#3337, #14775) and shell integration + the "select command" entries added in #15020.

That's not triple click, it's rightclick, move, left click, but still

@zadjii-msft commented on GitHub (Jul 20, 2023): I am TEMPTED to axe this, in favor of the `experimental.rightClickContextMenu` (#3337, #14775) and shell integration + the "select command" entries added in #15020. ![](https://user-images.githubusercontent.com/18356694/222840120-7a2493b2-2264-4e94-af2b-17bfacc90353.gif) That's not triple click, it's rightclick, move, left click, but still
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13529