wsl.exe pty setup depends on terminfo entry
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
### Windows Version
[Version 10.0.19045.6036]
### WSL Version
2.5.9.0
### Are you using WSL 1 or WSL 2?
- [ ] WSL 2
- [x] WSL 1
### Kernel Version
_No response_
### Distro Version
any
### Other Software
wsl run from a pty-based terminal (like Cygwin Terminal or xterm)
### Repro Steps
Start cmd.exe, navigate into cygwin installation subdirectory bin.
In the cygwin installation, remove /usr/share/terminfo/78/xterm (or rather move it away...).
Run `mintty - `. Or run for example `mintty -o Term=vt420`, after removing _that_ terminfo file.
From the terminal, run `wsl`. Or use `-d` to run any distro.
### Expected Behavior
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
Linux will start (confirm with any command) but there is no prompt.
`stty -a` fails, `tty` says `not a tty`. Apparently the WSL shell is running in non-tty mode.
### Diagnostic Logs
_No response_
Contributor guide
Research direction
Reproduce the failure by removing /usr/share/terminfo/78/xterm, launching mintty, and running wsl; compare the result with the terminfo entry present. Check stty -a and tty inside WSL, and consider the issue complete when a pty-based launch provides a prompt and normal control-character and tty behavior without that terminfo entry.
Written by the indexing model from the issue text.
Assessment
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100