Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Terminal: clipboard paste totally locks FAR #2329

Closed
ClusterM opened this issue Aug 2, 2024 · 7 comments · Fixed by #2333
Closed

Windows Terminal: clipboard paste totally locks FAR #2329

ClusterM opened this issue Aug 2, 2024 · 7 comments · Fixed by #2333

Comments

@ClusterM
Copy link
Contributor

ClusterM commented Aug 2, 2024

I'm using far2l via Windows Terminal and ssh. I have bound the clipboard paste action to Ctrl+Shift+V in terminal settings. So, I can use Ctrl+C and Ctrl+V to copy and paste text inside FAR, it works fine and doesn't conflict.

But when I want to paste text from Windows to remote system using Ctrl+Shift+V FAR totally freaks out. The text is pasted correctly, but then... FAR stops handling any escape sequences:

image
image

So, I can't even quit FAR.

Copypasting from remote side to local PC using OSC52 works fine, btw.

upd:
Seems like Windows Terminal sends weird escape code sequences. I inspected it.

Steps to reproduce via clean shell:

  1. Copy "test" string to the clipboard
  2. Run Windows Terminal
  3. Connect to Linux via SSH
  4. Type printf "\x1b[?9001h" to enable win32-input-mode
  5. Right-click on the terminal window to paste text from a clipboard

Expected Behavior

;4;20;116;1;0;1_;4;20;116;0;0;1_;18;101;1;0;1_;18;101;0;0;1_;3;31;115;1;0;1_;3;31;115;0;0;1_;4;20;116;1;0;1_;4;20;116;0;0;1_

It's t, e, s, t key presses.

Actual Behavior

;0;27;1;0;1_;0;91;1;0;1_;0;50;1;0;1_;0;48;1;0;1_;0;48;1;0;1_;0;126;1;0;1_4;20;116;1;0;1_4;20;116;0;0;1_;18;101;1;0;1_;18;101;0;0;1_3;31;115;1;0;1_3;31;115;0;0;1_4;20;116;1;0;1_4;20;116;0;0;1_;0;27;1;0;1_;0;91;1;0;1_;0;50;1;0;1_;0;48;1;0;1_;0;49;1;0;1_;0;126;1;0;1_

Decoded:

| Sequence          | Vk | Sc  | Uc  | Kd   | Cs | Rc | Description           |
|-------------------|----|-----|-----|------|----|----|-----------------------|
| `;0;27;1;0;1_`    | 0  | 27  | Esc | Down | 1  | 1  | Key Esc pressed       |
| `;0;91;1;0;1_`    | 0  | 91  | [   | Down | 1  | 1  | Key [ pressed         |
| `;0;50;1;0;1_`    | 0  | 50  | 2   | Down | 1  | 1  | Key 2 pressed         |
| `;0;48;1;0;1_`    | 0  | 48  | 0   | Down | 1  | 1  | Key 0 pressed         |
| `;0;48;1;0;1_`    | 0  | 48  | 0   | Down | 1  | 1  | Key 0 pressed         |
| `;0;126;1;0;1_`   | 0  | 126 | ~   | Down | 1  | 1  | Key ~ pressed         |
| `;4;20;116;1;0;1_`| 4  | 20  | t   | Down | 0  | 1  | Key t pressed         |
| `;4;20;116;0;0;1_`| 4  | 20  | t   | Up   | 0  | 1  | Key t released        |
| `;18;101;1;0;1_`  | 18 | 101 | e   | Down | 0  | 1  | Key e pressed         |
| `;18;101;0;0;1_`  | 18 | 101 | e   | Up   | 0  | 1  | Key e released        |
| `;3;31;115;1;0;1_`| 3  | 31  | s   | Down | 0  | 1  | Key s pressed         |
| `;3;31;115;0;0;1_`| 3  | 31  | s   | Up   | 0  | 1  | Key s released        |
| `;4;20;116;1;0;1_`| 4  | 20  | t   | Down | 0  | 1  | Key t pressed         |
| `;4;20;116;0;0;1_`| 4  | 20  | t   | Up   | 0  | 1  | Key t released        |
| `;0;27;1;0;1_`    | 0  | 27  | Esc | Down | 1  | 1  | Key Esc pressed       |
| `;0;91;1;0;1_`    | 0  | 91  | [   | Down | 1  | 1  | Key [ pressed         |
| `;0;50;1;0;1_`    | 0  | 50  | 2   | Down | 1  | 1  | Key 2 pressed         |
| `;0;48;1;0;1_`    | 0  | 48  | 0   | Down | 1  | 1  | Key 0 pressed         |
| `;0;49;1;0;1_`    | 0  | 49  | 1   | Down | 1  | 1  | Key 1 pressed         |
| `;0;126;1;0;1_`   | 0  | 126 | ~   | Down | 1  | 1  | Key ~ pressed         |

As you can see, there are much more key codes for some reason.

@ClusterM
Copy link
Contributor Author

ClusterM commented Aug 2, 2024

Seems more like Windows Terminal bug, actually.

@ClusterM
Copy link
Contributor Author

ClusterM commented Aug 2, 2024

Issue on the Windows Terminal repo: microsoft/terminal#17656

@unxed
Copy link
Contributor

unxed commented Aug 3, 2024

Have you seen #2072 and #2085? Is it the same problem or a different one?

As I see "Right-click on the terminal window", I guess it is also something mouse-related.

@unxed
Copy link
Contributor

unxed commented Aug 3, 2024

@Dazzar56 can you please take a look at this issue?

@ClusterM
Copy link
Contributor Author

ClusterM commented Aug 3, 2024

Have you seen #2072 and #2085? Is it the same problem or a different one?

Seems like it's the same problem, yes.

@ClusterM
Copy link
Contributor Author

ClusterM commented Aug 3, 2024

Answer from Microsoft employee: microsoft/terminal#17656 (comment)

@ClusterM
Copy link
Contributor Author

ClusterM commented Aug 3, 2024

fix: #2333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants