'Git autocompletion with WSL "Pseudo-terminal will not be allocated because stdin is not a terminal"

Autocompletion work well with all command except when I start my command line with git. When I'm trying to autocomplete command line with tab key, my shell trigger this error :

Pseudo-terminal will not be allocated because stdin is not a terminal.

I've seen lot's of trouble arround this error, but every error was about ssh command and I'm not running ssh in this case.

Is there any stuff to find at least, the problem, or just when this error is triggered, in which file, command, package, ...?

All version used:

  • WSL2 is running Ubuntu 20.04, with original OS Windows 11
  • Git version 2.25.1
  • bash-completion package installed
  • Terminal used is Hyper.js 3.2.0

Thanks for your help.



Solution 1:[1]

As illustrated in rprichard/wslbridge issue 45, you might need to configure Hyper.js to use wslbridge2 instead.

For recent changes in WSL, particularly WSL mode V2, the new gateway wslbridge2 should be used instead.

This old vercel/hyper issue 1127 showed how to set wslbridge. It can be adapted to use wslbridge2.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC