wsl.exe pty setup depends on terminfo entry (reopening #13226)

Open
#42,032 7 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp, linux

Research direction

Start by reproducing the reported failure: move the xterm terminfo entries from /usr/share/terminfo/78 and launch wsl from a Cygwin or MSYS2 pseudo-terminal. Compare the terminal setup with the entries present and missing; done means WSL still creates a working pseudo-terminal, with a prompt and functioning control characters, when those entries are absent. The issue does not name source files or tests, so locating the relevant setup code will take familiarity with WSL.

Written by the indexing model from the issue text.

Description

feature wsl1 wsl2
Windows Version

Microsoft Windows [Version 10.0.19045.7807] and Microsoft Windows [Version 10.0.26200.9711]

WSL Version

3.0.3.0

Are you using WSL 1, WSL 2, or WSLC?
  • WSL 2
  • WSL 1
  • WSLC
Kernel Version

varies with distro

Distro Version

various

Other Software

cygwin or MSYS2

Repro Steps

cd /usr/share/terminfo/78
mkdir sav
mv xterm* sav/

then start a new terminal window
in its shell, run
wsl [ -d DISTRO ]

Expected Behavior

Normal WSL shell should appear.
If run from a pty-based environment, proper pty handling should be set up.
The WSL shell should appear with prompt, control characters should work normally.
There is no reason to depend on terminfo entries for that purpose.

Actual Behavior

WSL shell is running but shows no prompt
stty -a fails
tty responds "not a tty"

Apparently the shell is running in non-tty mode.

Diagnostic Logs

No response

Dominant language
C++
Stars
34.4k
Forks
1.9k
Avg merge
1d 23h
Merged PRs (30d)
166

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/WSL

All issues in microsoft/WSL

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.