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

Ctrl Key Not Working in Vim over SSH with Specific Terminal Software #2324

Open
3 tasks done
waterexit opened this issue Jan 28, 2025 · 3 comments
Open
3 tasks done
Labels
Waiting on Author Need more information to diagnose

Comments

@waterexit
Copy link

waterexit commented Jan 28, 2025

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Introduction

I am using terminals like Wezterm and Xterm on Ubuntu to connect to Windows via SSH.
The default shell in this setup is WSL.
However, upon starting Vim, none of the operations involving the Ctrl key, such as Ctrl+W and Ctrl+R, work.
The keys Ctrl+C and Ctrl+Z function perfectly in the Bash shell, so this issue appears to occur only when Vim is launched.

Interestingly, this issue doesn't occur when using gnome-terminal.

Additionally, when using the Using terminals like wezterm and xterm to connect to an Ubuntu system via SSH, the problem does not occur.
Honestly, I'm not sure if this is an issue with Win32-OpenSSH that needs fixing, but I'm interested to know why this happens.

Expected behavior

Control key should work in Vim while using Wezterm or Xterm.

Actual behavior

Control key does not work in Vim while using Wezterm or Xterm.

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.19041.5369
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.5369
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version

OpenSSH_for_Windows_9.8p1 Win32-OpenSSH-GitHub, LibreSSL 3.9.2

@tgauth
Copy link
Collaborator

tgauth commented Feb 3, 2025

The default shell in this setup is WSL.

How are you configuring WSL as the default shell?

Also, have you tested with previous versions of OpenSSH, like v9.5? Curious if this is a regression in 9.8 or something that has not worked previously either.

@tgauth tgauth added the Waiting on Author Need more information to diagnose label Feb 3, 2025
@StevenBucher98
Copy link
Collaborator

I would also be curious if you see this happen when WSL is not the default shell, in case it is getting in the way of some previously used keybindings.

@waterexit
Copy link
Author

First of all, thank you for your response.

How are you configuring WSL as the default shell?

I configured it using the following command.

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\system32\bash.exe" -PropertyType String -Force

I would also be curious if you see this happen when WSL is not the default shell, in case it is getting in the way of some previously used keybindings.

However, after setting PowerShell as the default shell, it seems that the same issue occurs even when I open WSL with the wsl command and then open vim.

Additionally, when I open the Windows version of vim from PowerShell connected via SSH, the Ctrl key seems to function correctly.

Also, have you tested with previous versions of OpenSSH, like v9.5? Curious if this is a regression in 9.8 or something that has not worked previously either.

I downgraded to version 9.5 and tested it, but the same issue occurred.

@waterexit waterexit reopened this Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting on Author Need more information to diagnose
Projects
None yet
Development

No branches or pull requests

3 participants