Don't warn about multiline paste to editor #9731

Closed
opened 2026-01-31 02:02:26 +00:00 by claunia · 6 comments
Owner

Originally created by @KalleOlaviNiemitalo on GitHub (Jul 22, 2020).

Description of the new feature/enhancement

I want the https://github.com/microsoft/terminal/issues/2349 warning when pasting multiline text to a shell, but not when pasting to an editor that won't execute the lines as commands.

Proposed technical implementation details (optional)

Potential ways to detect such an editor:

Whichever heuristic is used, there is a risk that the editor is killed and the modes are left active. Perhaps the configuration should have a separate opt-in for each heuristic.

Originally created by @KalleOlaviNiemitalo on GitHub (Jul 22, 2020). # Description of the new feature/enhancement I want the <https://github.com/microsoft/terminal/issues/2349> warning when pasting multiline text to a shell, but not when pasting to an editor that won't execute the lines as commands. # Proposed technical implementation details (optional) Potential ways to detect such an editor: * If the alternate screen buffer is active (regardless of whether it has been temporarily hidden by <https://github.com/microsoft/terminal/issues/6451>). However, this heuristic would be fooled by `less`, which does execute lines starting with `!` as commands. * If bracketed paste mode (<https://github.com/microsoft/terminal/issues/395>) is active. That would first have to be implemented. [GNU Nano supports it.](<http://savannah.gnu.org/bugs/?40060> "bug #40060: [Request] implement bracketed paste mode, to suppress auto-indentation") * If any of the [mouse tracking](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking) modes is active. Whichever heuristic is used, there is a risk that the editor is killed and the modes are left active. Perhaps the configuration should have a separate opt-in for each heuristic.
Author
Owner

@zadjii-msft commented on GitHub (Jul 22, 2020):

Of those three options, the bracketed paste one is my favorite. Consider something like tmux, which is going to use the alt buffer and mouse tracking, but is also likely sitting at a shell prompt.

@zadjii-msft commented on GitHub (Jul 22, 2020): Of those three options, the bracketed paste one is my favorite. Consider something like `tmux`, which is going to use the alt buffer and mouse tracking, but is also likely sitting at a shell prompt.
Author
Owner

@vadimkantorov commented on GitHub (Aug 27, 2020):

Stumbled on this. This is annoying when copy-pasting code into vim, since there is no way to suppress the message after first appearance.

@vadimkantorov commented on GitHub (Aug 27, 2020): Stumbled on this. This is annoying when copy-pasting code into vim, since there is no way to suppress the message after first appearance.
Author
Owner

@zadjii-msft commented on GitHub (Aug 27, 2020):

I mean, there is these settings so there's not no way...

@zadjii-msft commented on GitHub (Aug 27, 2020): I mean, there is [these settings](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/global-settings#paste-warnings) so there's not _no_ way...
Author
Owner

@vadimkantorov commented on GitHub (Aug 27, 2020):

I meant no quick UI way, many apps would ask right away if one wants to suppress the message: "Do not show again" button kind of way

@vadimkantorov commented on GitHub (Aug 27, 2020): I meant no quick UI way, many apps would ask right away if one wants to suppress the message: "Do not show again" button kind of way
Author
Owner

@UID1 commented on GitHub (Oct 2, 2020):

Agree on this issue. When copying and pasting into a running ipython console or a Scala REPL then this warning is merely a nuisance. Those interactive enviroments know how to handle multi-line pastes.

@UID1 commented on GitHub (Oct 2, 2020): Agree on this issue. When copying and pasting into a running ipython console or a Scala REPL then this warning is merely a nuisance. Those interactive enviroments know how to handle multi-line pastes.
Author
Owner

@ghost commented on GitHub (Apr 14, 2021):

:tada:This issue was addressed in #9586, which has now been successfully released as Windows Terminal Preview v1.8.1032.0.🎉

Handy links:

@ghost commented on GitHub (Apr 14, 2021): :tada:This issue was addressed in #9586, which has now been successfully released as `Windows Terminal Preview v1.8.1032.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.8.1032.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9731