Some lines failed to be pasted when multi-pasting. #15510

Closed
opened 2026-01-31 04:40:42 +00:00 by claunia · 2 comments
Owner

Originally created by @lzfzzz on GitHub (Oct 11, 2021).

Windows Terminal version (or Windows build number)

10.0.19042.0

Other Software

Firefox 93.0
Ubuntu 20.04 LTS

Steps to reproduce

for remote in $(git remote show)
do
	fetch_url=`git remote get-url $remote | sed -e 's#**.**.**.**#**.**.**.**#' -e 's#**.**.**.**:80/#**.**.**.**:8080/#' -e 's#http://**.**.**.**/#http://**.**.**.**:8080/#'`
	push_url=`git remote get-url $remote --push | sed -e 's#**.**.**.**#**.**.**.**#' -e 's#**.**.**.**:80/#**.**.**.**:8080/#' -e 's#http://**.**.**.**/#http://**.**.**.**:8080/#'`
	git remote set-url $remote $fetch_url
	git remote set-url $remote $push_url --push
done

Paste the code above from Firefox (Windows) into bash (Ubuntu/WSL).

Expected Behavior

Paste 7 lines into bash.

Actual Behavior

The Windows Terminal preview is corrected.
QQ截图20211011194005

But only the first 2 lines of the code is pasted.
QQ截图20211011194020

Originally created by @lzfzzz on GitHub (Oct 11, 2021). ### Windows Terminal version (or Windows build number) 10.0.19042.0 ### Other Software Firefox 93.0 Ubuntu 20.04 LTS ### Steps to reproduce ```bash for remote in $(git remote show) do fetch_url=`git remote get-url $remote | sed -e 's#**.**.**.**#**.**.**.**#' -e 's#**.**.**.**:80/#**.**.**.**:8080/#' -e 's#http://**.**.**.**/#http://**.**.**.**:8080/#'` push_url=`git remote get-url $remote --push | sed -e 's#**.**.**.**#**.**.**.**#' -e 's#**.**.**.**:80/#**.**.**.**:8080/#' -e 's#http://**.**.**.**/#http://**.**.**.**:8080/#'` git remote set-url $remote $fetch_url git remote set-url $remote $push_url --push done ``` Paste the code above from Firefox (Windows) into bash (Ubuntu/WSL). ### Expected Behavior Paste 7 lines into bash. ### Actual Behavior The Windows Terminal preview is corrected. ![QQ截图20211011194005](https://user-images.githubusercontent.com/84131394/136784555-b7481e4a-efef-4096-a02a-533237a1c2c0.png) But only the first 2 lines of the code is pasted. ![QQ截图20211011194020](https://user-images.githubusercontent.com/84131394/136784811-559d5ba2-da0c-4b8a-ab3c-061ca5af7969.png)
claunia added the Needs-TriageNeeds-Tag-FixProduct-Terminal labels 2026-01-31 04:40:43 +00:00
Author
Owner

@elsaco commented on GitHub (Oct 11, 2021):

@lzfzzz there's a warning when pasting text containing multiple lines:

If you paste this text into your shell, it may result in the unexpected execution of commands.

So, when pasting the for loop it actually executes:

tux@RIPPER:~/repos/tmux$ for remote in $(git remote show)
fetch_u> do
> fetch_url=`git remote get-url $remote | sed -e 's#**.**.**.**#**.**.**.**#' -e 's#**.**.**.**:80/#**.**.**.**:8080/#' -e 's#http://**.**.**.**/#http://**.**.**.**:8080/#'`
> push_url=`git remote get-url $remote --push | sed -e 's#**.**.**.**#**.**.**.**#' -e 's#**.**.**.**:80/#**.**.**.**:8080/#' -e 's#http://**.**.**.**/#http://**.**.**.**:8080/#'`
> git remote set-url $remote $fetch_url
> git remote set-url $remote $push_url --push
> done

This was tried in a git repo so $(git remote show) would work.

@elsaco commented on GitHub (Oct 11, 2021): @lzfzzz there's a warning when pasting text containing multiple lines: `If you paste this text into your shell, it may result in the unexpected execution of commands.` So, when pasting the for loop it actually executes: ``` tux@RIPPER:~/repos/tmux$ for remote in $(git remote show) fetch_u> do > fetch_url=`git remote get-url $remote | sed -e 's#**.**.**.**#**.**.**.**#' -e 's#**.**.**.**:80/#**.**.**.**:8080/#' -e 's#http://**.**.**.**/#http://**.**.**.**:8080/#'` > push_url=`git remote get-url $remote --push | sed -e 's#**.**.**.**#**.**.**.**#' -e 's#**.**.**.**:80/#**.**.**.**:8080/#' -e 's#http://**.**.**.**/#http://**.**.**.**:8080/#'` > git remote set-url $remote $fetch_url > git remote set-url $remote $push_url --push > done ``` This was tried in a git repo so $(git remote show) would work.
Author
Owner

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

Hey we looped back on this one - we think this is because the output has tabs in it, instead of spaces. If you convert them to spaces, this will work as expected.

Alternatively, you could try enabling bracketed paste in bash:https://stackoverflow.com/a/44507798/1481137

Or permanently in your .inputrc:

set enable-bracketed-paste on
@zadjii-msft commented on GitHub (Jul 5, 2023): Hey we looped back on this one - we think this is because the output has tabs in it, instead of spaces. If you convert them to spaces, this will work as expected. Alternatively, you could try enabling bracketed paste in bash:https://stackoverflow.com/a/44507798/1481137 > Or permanently in your .inputrc: > ``` > set enable-bracketed-paste on > ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15510