microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.45k stars 822 forks source link

WSL automatically inserts a ~ character #12073

Closed ndland closed 1 month ago

ndland commented 1 month ago

Windows Version

Microsoft Windows [Version 10.0.22631.4112]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.153.1

Distro Version

Ubuntu 24.04

Other Software

Docker Desktop (Windows)

Repro Steps

Start up a terminal, afk, ~ is automatically inserted into terminal

Expected Behavior

No characters are automatically inserted into the terminal.

Actual Behavior

The ~ character appears if the terminal window is active, and afk'd

Diagnostic Logs

No response

github-actions[bot] commented 1 month ago

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs Download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: ``` Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1 ``` The script will output the path of the log file once done. If this is a networking issue, please use [collect-networking-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1), following the instructions [here](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues) Once completed please upload the output files to this Github issue. [Click here for more info on logging](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.
ndland commented 1 month ago

WslLogs-2024-09-24_18-27-15.zip

github-actions[bot] commented 1 month ago
Diagnostic information ``` Detected appx version: 2.2.4.0 ```
Raven-Singularity commented 1 month ago

Did this character always appear on your Ubuntu, or did this start happening recently?

OneBlue commented 1 month ago

@ndland: Can you share a video of where and how this character gets inserted ?

zcobol commented 1 month ago

@ndland how do you launch the WSL instance? Does tilde is inserted when running ubuntu2404.exe also? Check your launch command. In bash the ~ expands to your home directory.

Kazmirchuk commented 1 month ago

this could be caused by software like Caffeine that sends a virtual keystroke e.g. every minute to keep your screen unlocked

ndland commented 1 month ago

this could be caused by software like Caffeine that sends a virtual keystroke e.g. every minute to keep your screen unlocked

Holy shit. I never even considered that. You might be on to something... I do have Caffeine. At any rate, here is a gif of this happening.

WindowsTerminal_fJGPPPa4SG

ndland commented 1 month ago

this could be caused by software like Caffeine that sends a virtual keystroke e.g. every minute to keep your screen unlocked

Holy shit. I never even considered that. You might be on to something... I do have Caffeine. At any rate, here is a gif of this happening.

WindowsTerminal_fJGPPPa4SG WindowsTerminal_fJGPPPa4SG

As a test, I killed Caffeine, and I ran the same test, and it doesn't appear to be doing the same thing anymore. My guess is, Caffeine is the culprit. Unreal, but thank you @Kazmirchuk for pointing this out.

zcobol commented 1 month ago

The screenshots revealed more information. It's not just a tilde inserted. [28 is the beginning of an ANSI control sequence, and that's conceal off. Looks like you have a broken sequence somewhere.

Too much caffeine!? 😀

ndland commented 1 month ago

Ironically, the [28 appeared after I switched to fish. When I was using zsh it was just a ~. Either way, yes, I think I've either had too much or not enough of caffeine. 😆

OneBlue commented 1 month ago

Thank you for followup on this ! Closing since the issue caused by third party software.