PowerShell / ConsoleGuiTools

Modules that mix PowerShell and GUIs/CUIs!
https://www.powershellgallery.com/packages/Microsoft.PowerShell.ConsoleGuiTools
MIT License
794 stars 60 forks source link

[Linux] [Ubuntu 20.04] Leaving OCGV causes mouse move to print characters to console #134

Closed En3Tho closed 3 years ago

En3Tho commented 3 years ago

image

En3Tho commented 3 years ago

@tig @TylerLeonhardt Can you please take a look?

En3Tho commented 3 years ago

I've updated pwsh to 7.1.1 manually (no such version in apt-get), problem remains

tig commented 3 years ago

see https://github.com/PowerShell/PowerShell/issues/12268

DHowett commented 3 years ago

This is a different thing, isn't it? Those characters look like xterm-encoded mouse positions. It looks like OCGV is leaving mouse mode enabled.

The issue you linked, 12268, is about the encoding for the keyboard arrow keys (the up/down/left/right cluster.)

En3Tho commented 3 years ago

Screenshot_2021-01-23-16-10-08-621_tech.ula.jpg No such behaviour on Android via UserLAnd (Ubuntu) Tested it just for the fun of it. Thanks, @tig

TylerLeonhardt commented 3 years ago

@En3Tho can you run this line and see if you still see the behavior?:

Write-Host "`e[?1003l"

This will turn of Mouse Tracking as described here: https://www.xfree86.org/current/ctlseqs.html#Mouse%20Tracking

If this works for you, we can add emitting this here: https://github.com/PowerShell/GraphicalTools/blob/master/src/Microsoft.PowerShell.ConsoleGuiTools/ConsoleGui.cs#L329

En3Tho commented 3 years ago

@TylerLeonhardt It works. Thanks!

TylerLeonhardt commented 3 years ago

opened a small PR to fix this: https://github.com/PowerShell/GraphicalTools/pull/135