Wrong Character of multiple-line paste in Linux server visited from Windows Terminal #20762

Closed
opened 2026-01-31 07:23:18 +00:00 by claunia · 6 comments
Owner

Originally created by @huangwb8 on GitHub (Nov 3, 2023).

Windows Terminal version

1.18.2822.0

Windows build number

10.0.19041.572

Other Software

Ubuntu 18.04.3 LTS (GNU/Linux 5.4.0-050400-generic x86_64)

Steps to reproduce

  1. Connect to the Ubuntu server via ssh from Windows Terminal. like:
ssh -i  -p 22 root@192.168.1.xxx
  1. Paste a code like:
ws=/home/Test/abcde
nbin=$ws/bin
export PATH=$ws/bin:$PATH
cd $ws

Expected Behavior

The code is just shown what it is.

Actual Behavior

Like:

WindowsTerminal_OwVpO983m6

There are some strange errors.

Other try:

  1. This error would not appear in the local PowerShell.
  2. This error would be a little bit different from Linux servers connected.
  3. This error never happen if I use shell tools like MobaXterm or FinalShell.
Originally created by @huangwb8 on GitHub (Nov 3, 2023). ### Windows Terminal version 1.18.2822.0 ### Windows build number 10.0.19041.572 ### Other Software Ubuntu 18.04.3 LTS (GNU/Linux 5.4.0-050400-generic x86_64) ### Steps to reproduce 1. Connect to the Ubuntu server via ssh from Windows Terminal. like: ``` ssh -i -p 22 root@192.168.1.xxx ``` 2. Paste a code like: ``` ws=/home/Test/abcde nbin=$ws/bin export PATH=$ws/bin:$PATH cd $ws ``` ### Expected Behavior The code is just shown what it is. ### Actual Behavior Like: ![WindowsTerminal_OwVpO983m6](https://github.com/microsoft/terminal/assets/35643122/b76cf1ea-7ba2-4a7d-aaf4-676a7adfc496) There are some strange errors. Other try: 1. This error would not appear in the local PowerShell. 2. This error would be a little bit different from Linux servers connected. 3. This error never happen if I use shell tools like MobaXterm or FinalShell.
claunia added the Issue-BugResolution-ExternalNeeds-Tag-FixProduct-Terminal labels 2026-01-31 07:23:19 +00:00
Author
Owner

@lhecker commented on GitHub (Nov 7, 2023):

What happens if run this and then paste?

set enable-bracketed-paste on

What happens if you do this instead?

set enable-bracketed-paste off
@lhecker commented on GitHub (Nov 7, 2023): What happens if run this and then paste? ```sh set enable-bracketed-paste on ``` What happens if you do this instead? ```sh set enable-bracketed-paste off ```
Author
Owner

@huangwb8 commented on GitHub (Nov 7, 2023):

@lhecker

set enable-bracketed-paste on:

WindowsTerminal_nSsvaOWU13

set enable-bracketed-paste off:

WindowsTerminal_2ebrPhbBBf

There're some differences, but the problem still exists.

@huangwb8 commented on GitHub (Nov 7, 2023): @lhecker `set enable-bracketed-paste on`: ![WindowsTerminal_nSsvaOWU13](https://github.com/microsoft/terminal/assets/35643122/7b5d0cdd-1e07-4af4-8118-c291522acde6) `set enable-bracketed-paste off`: ![WindowsTerminal_2ebrPhbBBf](https://github.com/microsoft/terminal/assets/35643122/0b41e01f-27f6-4f37-9730-783781fa82cd) There're some differences, but the problem still exists.
Author
Owner

@carlos-zamora commented on GitHub (Nov 8, 2023):

Hi @huangwb8. Can you capture a debug tap for us following this guide? Thank you!
https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#enabling-the-debug-tap

@carlos-zamora commented on GitHub (Nov 8, 2023): Hi @huangwb8. Can you capture a debug tap for us following this guide? Thank you! https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#enabling-the-debug-tap
Author
Owner

@carlos-zamora commented on GitHub (Nov 8, 2023):

Also, does it repro if you run ssh -t user@machine zsh -f?

@carlos-zamora commented on GitHub (Nov 8, 2023): Also, does it repro if you run `ssh -t user@machine zsh -f`?
Author
Owner

@huangwb8 commented on GitHub (Nov 8, 2023):

Hi @huangwb8. Can you capture a debug tap for us following this guide? Thank you! https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#enabling-the-debug-tap

The debug tap could only be opened in local terminal:

image

WindowsTerminal_ase4VVucH7

======

Also, does it repro if you run ssh -t user@machine zsh -f?

It seems the right direction to solve the problem:

WindowsTerminal_6mJjNyIhOB

I want to keep zsh in the Ubuntu sever connected. Is it possible?

@huangwb8 commented on GitHub (Nov 8, 2023): > Hi @huangwb8. Can you capture a debug tap for us following this guide? Thank you! https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#enabling-the-debug-tap The debug tap could only be opened in local terminal: ![image](https://github.com/microsoft/terminal/assets/35643122/5ffe31fb-f59f-41dc-aaf0-e58910e47653) ![WindowsTerminal_ase4VVucH7](https://github.com/microsoft/terminal/assets/35643122/8677b04a-3f2a-46aa-9e23-7bbee01d7b02) ====== > Also, does it repro if you run `ssh -t user@machine zsh -f`? It seems the right direction to solve the problem: ![WindowsTerminal_6mJjNyIhOB](https://github.com/microsoft/terminal/assets/35643122/f635b9ff-7f80-45ab-b186-ea1d63174d17) I want to keep zsh in the Ubuntu sever connected. Is it possible?
Author
Owner

@DHowett commented on GitHub (Nov 15, 2023):

Thanks for testing that out! It looks like there is something in your zsh configuration (.zshrc or oh-my-zsh, depending on how you have configured it) that is causing this. It does not look like a Terminal issue.

I recommend you check your prompt_command, precmd, or any other "command" hooks you have enabled.

I want to keep zsh in the Ubuntu sever connected. Is it possible?

I am sorry, I do not know how we can help you.

@DHowett commented on GitHub (Nov 15, 2023): Thanks for testing that out! It looks like there is something in your `zsh` configuration (`.zshrc` or `oh-my-zsh`, depending on how you have configured it) that is causing this. It does not look like a Terminal issue. I recommend you check your `prompt_command`, `precmd`, or any other "command" hooks you have enabled. > I want to keep zsh in the Ubuntu sever connected. Is it possible? I am sorry, I do not know how we can help you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20762