Clipboard and Mouse Issues in Windows Terminal

Bug #2083233 reported by Unxed
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
far2l (Ubuntu)
Fix Released
Undecided
Unassigned
Noble
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

 * In some versions of Windows Terminal, there's a notorious bug known as
   "double encoding of escape sequences."

   https://github.com/microsoft/terminal/issues/15083

   This bug causes garbage characters to appear in the input of far2l
   when the mouse is moved.

   The same bug also causes problems with the bracketed paste
   functionality.

   https://github.com/microsoft/terminal/issues/17656

 * Furthermore, far2l itself has two issues that exacerbate the situation:
   1) it generates garbage input when receiving unsupported mouse events

   https://github.com/elfmz/far2l/issues/2423

   2) in win32-input-mode, which is used in Windows Terminal, the zero keycode
   should be replaced with the VK_UNASSIGNED constant. Otherwise, Cyrillic
   characters (and probably characters of other non-Latin scripts) are ignored
   in the data pasted from the clipboard into the terminal

   https://github.com/elfmz/far2l/issues/2424

 * All listed problems are fixed in the master branch of far2l.

 * Windows Terminal problems are fixed by implementing a workaround:

   https://github.com/elfmz/far2l/issues/2072

 * Backporting fixes from the master branch will improve Windows Terminal
   users UX, both then working in WSL[g] environments or then running far2l
   on remote machines via ssh

[ Test Plan ]

   On Windows system:

    1. Copy some Cyrillic string to system clipboard
    ("это строка для проверки", for example).

    2. Open Windows Terminal

    3. Run far2l inside (in 24.04, in local WSL[g]
    or by connecting by ssh to remote host)

    4. Ask Windows Terminal to do paste by pressing Ctrl+V or Shift+Ins

    5. Try to move mouse over the far2l window

   Text should be pasted ok and no input garbage should appear

[ Where problems could occur ]

 * Some input errors in Windows Terminal may occur.
   However, this way of input processing has been tested in ppa builds
   from master branch by volunteers and no problems were found.

 * Also, the fix is Windows Terminal-specific. Even if it breaks
   something, working in cmd.exe console window
   still would be possible.

[ Other Info ]

 * wsl_fixes_2410.patch contains fixes backported to 24.10

 * ubuntu_wt_fixes.patch contains fixes backported to 24.04

 * fix_wt_paste.patch is incomplete and should not be used

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: 2.6.0~beta+ds-1ubuntu0.2
Architecture: amd64
SourcePackage: far2l

Revision history for this message
Unxed (unxed) wrote :
description: updated
Revision history for this message
Unxed (unxed) wrote :

Fixes backported from upstream master.

Unxed (unxed)
tags: added: oracular
removed: noble
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "wsl_fixes_2410.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package far2l - 2.6.3~beta+ds-1ubuntu4

---------------
far2l (2.6.3~beta+ds-1ubuntu4) oracular; urgency=medium

  * Backport upstream patch to fix mouse and clipboard in WSL (LP: #2083233).

 -- Dmitry Shachnev <email address hidden> Tue, 01 Oct 2024 00:16:19 +0300

Changed in far2l (Ubuntu):
status: New → Fix Released
Unxed (unxed)
summary: - mouse and clipboard are not working in windows terminal under wsl
+ pasting of Cyrillic chars not working in windows terminal under wsl
Revision history for this message
Unxed (unxed) wrote (last edit ):

This patch is incomplete and outdated. It should not be used.

Unxed (unxed)
description: updated
Unxed (unxed)
description: updated
Revision history for this message
Unxed (unxed) wrote (last edit ):

Upstream fixes backported to 24.04

Unxed (unxed)
description: updated
Unxed (unxed)
summary: - pasting of Cyrillic chars not working in windows terminal under wsl
+ Clipboard and Mouse Issues in Windows Terminal
Unxed (unxed)
description: updated
Unxed (unxed)
description: updated
tags: added: noble
removed: oracular
Unxed (unxed)
description: updated
Unxed (unxed)
description: updated
description: updated
description: updated
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Unxed, or anyone else affected,

Accepted far2l into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/far2l/2.6.0~beta+ds-1ubuntu0.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in far2l (Ubuntu Noble):
status: New → Fix Committed
tags: added: verification-needed verification-needed-noble
Revision history for this message
Unxed (unxed) wrote :

Tested
2.6.0~beta+ds-1ubuntu0.3
from
https://launchpad.net/ubuntu/+source/far2l/2.6.0~beta+ds-1ubuntu0.3/+build/29170121

in 24.04.

The bug is fixed.

tags: added: verification-done-noble
removed: verification-needed-noble
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package far2l - 2.6.0~beta+ds-1ubuntu0.3

---------------
far2l (2.6.0~beta+ds-1ubuntu0.3) noble; urgency=medium

  * Backport upstream patch to fix mouse and clipboard in WSL (LP: #2083233).
  * Backport upstream patch to fix opening files from /etc in far2ledit
    (LP: #2084045).
  * Backport upstream patch to fix highlighting of smarty PHP templates
    (LP: #2084094).

 -- Dmitry Shachnev <email address hidden> Thu, 10 Oct 2024 21:52:11 +0300

Changed in far2l (Ubuntu Noble):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for far2l has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.