summary refs log tree commit diff stats
path: root/results/classifier/gemma3:12b/device/2843
blob: 34530f0a45a636225cfb71eedcfd9e719ab33500 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Strange stdin/out <-> console issue (paste problem) . May be char-win-stdio.c bug.
Description of problem:
I was trying to execute QEMU with VM from command line(shell) and work inside a VM within that initial console. All goes well except... pasting from clipboard. Pastings from clipboard are truncated to somewhat less (no more) then a terminal width (in columns).

I understand that it seems to be far from QEMU but I tried different terminals/shells/guest systems with the same result. The only things remain the same - QEMU.
Steps to reproduce:
In Windows open a console (shell). Run QEMU with guest serial attached to QEMU stdio. Try to paste some text. Pasted text will be truncated to 15-35 characters. Before QEMU run and after QEMU exit text pasted normally.
Additional information:
-  Shell probed: **cmd**, **powershell**
- Terminals probed: **Windows Terminal**, **Alacritty**, **Wezterm**, **Windows Terminal Preview**
- Guest probed: **Alpine Linux**, **FreeBSD**
- Setting inside guest probed: various terminal speed/options via **stty**
- QEMU arguments probed: from **-nographics** to manually define **-chardev/-serial** with/without **-mon**.

Finally I gave up. But want to mention that there are may be bug in source. When I tried to study source to find a hint for my issue I found that (char-win-stdio.c, line 162):
```
is_console = GetConsoleMode(stdio->hStdIn, &dwMode) != 0;
    stdio->dwOldMode = dwMode;

    if (is_console) {
```

Documentation of **GetConsoleMode** function says:
```
Return value:

If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
```

If understand correctly **is_console** will always be _true_. It will be _false_ only in case of invalid **stdio->hStdIn**.

I don't how this is related to my issue just put here all info I have in hope of resolving.