Pasting multiline text not working (in shell, vi and hangs kakoune) #21879

Open
opened 2026-01-31 07:57:15 +00:00 by claunia · 3 comments
Owner

Originally created by @ant5 on GitHub (Jun 19, 2024).

Windows Terminal version

1.21.1382.0

Windows build number

10.0.19045.4291

Other Software

QEMU 9.0 with FreeBSD 14.1 guest.
vi 2.2.1
kakoune-2024.05.18

Evironment:
TERM=xterm-256color

Steps to reproduce

Copy multiline text:

builder {
        host.hostname = "builder";
        path = "/ws/builder";
        ip4 = "inherit";
        #ip4.addr = "igb0|192.168.0.28/25";
        #ip4.addr = "lo0|127.0.3.1/24";
        allow.raw_sockets = 1;
        exec.consolelog = "/var/log/jails/${name}_console.log";
        #mount.fdescfs;
    #mount.fstab="/etc/ws/${name}.fstab";
        mount.procfs;
        allow.set_hostname = 0;
        exec.start = "/bin/sh /etc/rc";
        exec.stop = "/bin/sh /etc/rc.shutdown";
        exec.clean;
        allow.mount;
    allow.mount.zfs;
    allow.mount.nullfs;
  1. Run vi editor. Press i for insert mode. Paste text.
  2. Run vi editor. Press \i for insert mode with no-hook processing. Paste text.

Expected Behavior

Pasted text inside editor.

Actual Behavior

  1. vi editor. WindowsTerminal ask about pasting multiline text. Then only two lines of text pasted:
    image

  2. kakoune editor. WindowsTerminal do not ask about pasting multiline text. Nothing happen on screen but kakoune hangs in mean of not responding to any key press:

image

Also in a pure sh shell pasting behave like in vi (pasted only first two lines):

image

Originally created by @ant5 on GitHub (Jun 19, 2024). ### Windows Terminal version 1.21.1382.0 ### Windows build number 10.0.19045.4291 ### Other Software QEMU 9.0 with FreeBSD 14.1 guest. vi 2.2.1 kakoune-2024.05.18 Evironment: TERM=xterm-256color ### Steps to reproduce Copy multiline text: ``` builder { host.hostname = "builder"; path = "/ws/builder"; ip4 = "inherit"; #ip4.addr = "igb0|192.168.0.28/25"; #ip4.addr = "lo0|127.0.3.1/24"; allow.raw_sockets = 1; exec.consolelog = "/var/log/jails/${name}_console.log"; #mount.fdescfs; #mount.fstab="/etc/ws/${name}.fstab"; mount.procfs; allow.set_hostname = 0; exec.start = "/bin/sh /etc/rc"; exec.stop = "/bin/sh /etc/rc.shutdown"; exec.clean; allow.mount; allow.mount.zfs; allow.mount.nullfs; ``` 1. Run `vi` editor. Press `i` for insert mode. Paste text. 2. Run `vi` editor. Press `\i` for insert mode with no-hook processing. Paste text. ### Expected Behavior Pasted text inside editor. ### Actual Behavior 1. `vi` editor. WindowsTerminal ask about pasting multiline text. Then only two lines of text pasted: ![image](https://github.com/microsoft/terminal/assets/11061796/2c70ee6f-0b00-4238-a9ef-8e1d05b4dc77) 2. `kakoune` editor. WindowsTerminal do not ask about pasting multiline text. Nothing happen on screen but `kakoune` hangs in mean of not responding to any key press: ![image](https://github.com/microsoft/terminal/assets/11061796/59ffc4eb-6c99-4897-b17b-6120b5e8d6e0) Also in a pure `sh` shell pasting behave like in `vi` (pasted only first two lines): ![image](https://github.com/microsoft/terminal/assets/11061796/8a4a15cf-f972-4f7d-b00e-94c63fc52a7a)
claunia added the Issue-BugArea-InputProduct-TerminalPriority-2 labels 2026-01-31 07:57:15 +00:00
Author
Owner

@lhecker commented on GitHub (Jun 19, 2024):

Could this be the same as #17384?

@lhecker commented on GitHub (Jun 19, 2024): Could this be the same as #17384?
Author
Owner

@ant5 commented on GitHub (Jun 19, 2024):

May be there is a relation but I dont't feel it the same:

  1. #17384 uses WSL
  2. #17384 goes to deadlock. In my case neither shell nor vi hangs. Kakoune hangs (stop responding) but if I'm inside tmux I can TERM it easily.
  3. #17384 has 4096 bytes pasted. In my case just two lines really pasted (appear).

As you can see on screenshot WT really send all text to paste but something brokes. May be it related to CR/LF.

Also I must add some info: on WT command chcp 65001 ran before QEMU run.

@ant5 commented on GitHub (Jun 19, 2024): May be there is a relation but I dont't feel it the same: 1. #17384 uses WSL 2. #17384 goes to deadlock. In my case neither `shell` nor `vi` hangs. `Kakoune` hangs (stop responding) but if I'm inside `tmux` I can TERM it easily. 3. #17384 has 4096 bytes pasted. In my case just two lines really pasted (appear). As you can see on screenshot WT really send all text to paste but something brokes. May be it related to CR/LF. Also I must add some info: on WT command `chcp 65001` ran before QEMU run.
Author
Owner

@ant5 commented on GitHub (Jun 20, 2024):

I looked at screenshots more carefully and found strange thing.

WT send text with CR as newline separator. Does it have to send LF or CRLF?

@ant5 commented on GitHub (Jun 20, 2024): I looked at screenshots more carefully and found strange thing. WT send text with CR as newline separator. Does it have to send LF or CRLF?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21879