Cyrillic characters are not pasted correctly when using far2l in WSL under Windows Terminal #22318

Closed
opened 2026-01-31 08:09:41 +00:00 by claunia · 7 comments
Owner

Originally created by @unxed on GitHub (Sep 27, 2024).

Windows Terminal version

Windows Terminal Preview v1.22.2702.0

Steps to reproduce

  1. Install Ubuntu 24.04 in WSL
  2. Install the far2l package
  3. Run far2l in Windows Terminal
  4. Try to paste any Cyrillic text into far2l

Expected Behavior

Correct text is pasted

Actual Behavior

No Cyrillic text is pasted

The same operation works ok in GNOME Terminal under plain Ubuntu, for example.

Originally created by @unxed on GitHub (Sep 27, 2024). ### Windows Terminal version Windows Terminal Preview v1.22.2702.0 ### Steps to reproduce 1. Install Ubuntu 24.04 in WSL 2. Install the [far2l](https://github.com/elfmz/far2l) package 3. Run `far2l` in Windows Terminal 4. Try to paste any Cyrillic text into far2l ### Expected Behavior Correct text is pasted ### Actual Behavior No Cyrillic text is pasted The same operation works ok in GNOME Terminal under plain Ubuntu, for example.
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 08:09:41 +00:00
Author
Owner

@DHowett commented on GitHub (Sep 27, 2024):

Does it work when you paste into any other application under WSL/?

@DHowett commented on GitHub (Sep 27, 2024): Does it work when you paste into any other application under WSL/?
Author
Owner

@unxed commented on GitHub (Sep 28, 2024):

In bash is pasted ok.

But paste in far2l in other terminals (for example, gnome terminal under plain Ubuntu) also works ok

@unxed commented on GitHub (Sep 28, 2024): In bash is pasted ok. But paste in far2l in other terminals (for example, gnome terminal under plain Ubuntu) also works ok
Author
Owner

@unxed commented on GitHub (Sep 28, 2024):

This issue is not reproduces in cmd.exe console window.

@unxed commented on GitHub (Sep 28, 2024): This issue is not reproduces in `cmd.exe` console window.
Author
Owner

@o-sdn-o commented on GitHub (Sep 28, 2024):

It seems to me that far2l parses the win32-input-mode protocol incorrectly.

As an example, let's take the character й (UTF-16 decimal code 1081).

Request win32-input-mode by issuing printf "\x1b[?9001h" at the WSL prompt.

Pressing/releasing й generates: ←[1;16;1081;1;0;1_←[1;16;1081;0;0;1_
Pasting й generates: ←[;0;1081;1;0;1_←[;0;1081;0;0;1_

It is clear that the character й is delivered.

The same behavior in far2l when pasting CJK characters ちちちちちちちちちちち (UTF-16 decimal code 12385).

In the cmd.exe console window, win32-input-mode doesn't work (al least on my setup with Windows 10).

win32-input-mode CSI sequence for reference:

  ^[ [ Vk ; Sc ; Uc ; Kd ; Cs ; Rc _

       Vk: the value of wVirtualKeyCode - any number. If omitted, defaults to '0'.

       Sc: the value of wVirtualScanCode - any number. If omitted, defaults to '0'.

       Uc: the decimal value of UnicodeChar - for example, NUL is "0", LF is
           "10", the character 'A' is "65". If omitted, defaults to '0'.

       Kd: the value of bKeyDown - either a '0' or '1'. If omitted, defaults to '0'.

       Cs: the value of dwControlKeyState - any number. If omitted, defaults to '0'.

       Rc: the value of wRepeatCount - any number. If omitted, defaults to '1'.

@o-sdn-o commented on GitHub (Sep 28, 2024): It seems to me that far2l parses the win32-input-mode protocol incorrectly. As an example, let's take the character `й` (UTF-16 decimal code 1081). Request `win32-input-mode` by issuing `printf "\x1b[?9001h"` at the WSL prompt. Pressing/releasing `й` generates: `←[1;16;1081;1;0;1_←[1;16;1081;0;0;1_` Pasting `й` generates: `←[;0;1081;1;0;1_←[;0;1081;0;0;1_` It is clear that the character `й` is delivered. The same behavior in far2l when pasting CJK characters `ちちちちちちちちちちち` (UTF-16 decimal code 12385). In the cmd.exe console window, win32-input-mode doesn't work (al least on my setup with Windows 10). [win32-input-mode CSI sequence](https://github.com/microsoft/terminal/blob/main/doc/specs/%234999%20-%20Improved%20keyboard%20handling%20in%20Conpty.md#win32-input-mode-sequences) for reference: ``` ^[ [ Vk ; Sc ; Uc ; Kd ; Cs ; Rc _ Vk: the value of wVirtualKeyCode - any number. If omitted, defaults to '0'. Sc: the value of wVirtualScanCode - any number. If omitted, defaults to '0'. Uc: the decimal value of UnicodeChar - for example, NUL is "0", LF is "10", the character 'A' is "65". If omitted, defaults to '0'. Kd: the value of bKeyDown - either a '0' or '1'. If omitted, defaults to '0'. Cs: the value of dwControlKeyState - any number. If omitted, defaults to '0'. Rc: the value of wRepeatCount - any number. If omitted, defaults to '1'. ```
Author
Owner

@unxed commented on GitHub (Sep 28, 2024):

Thanks for investigating. Trying to fix that.
https://github.com/elfmz/far2l/pull/2401

btw, win32-input-mode seems to be working somehow even in cmd.exe: look at "w" char (after X) in window title. This char is appended on first successfull win32 input mode sequence decoding:
изображение

@unxed commented on GitHub (Sep 28, 2024): Thanks for investigating. Trying to fix that. https://github.com/elfmz/far2l/pull/2401 btw, win32-input-mode seems to be working somehow even in cmd.exe: look at "w" char (after X) in window title. This char is appended on first successfull win32 input mode sequence decoding: ![изображение](https://github.com/user-attachments/assets/4e95d14f-5b0a-418e-8adf-85669879ccac)
Author
Owner

@unxed commented on GitHub (Sep 28, 2024):

Closing as problem confirmed on far2l side

@unxed commented on GitHub (Sep 28, 2024): Closing as problem confirmed on far2l side
Author
Owner

@unxed commented on GitHub (Oct 7, 2024):

@ClusterM

Does this bug reproduce for you in far2l from Ubuntu 24.04 repo under latest Windows Terminal Preview version (v1.22.2702.0)?

@unxed commented on GitHub (Oct 7, 2024): @ClusterM Does this bug reproduce for you in far2l from Ubuntu 24.04 repo under latest Windows Terminal Preview version (v1.22.2702.0)?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22318