Open mikoto2000 opened 1 day ago
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.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!
TIOCGWINSZ
returns wrong data when wsl
called without console or with stdout/stderr redirected (#10701), similarity score: 0.78Note: You can give me feedback by thumbs upping or thumbs downing this comment.
I uploaded WslLogs.
@mikoto2000 what terminal are you using?
xterm
output:
zcobol@texas:~/pixel$ ./termsize
cols 80 rows 24, xpixel 804, ypixel 460.
windows terminal
output;
zcobol@texas:~/pixel$ ./termsize
cols 120 rows 30, xpixel 0, ypixel 0.
I try windows terminal preview
, mintty
, wsltty
and wezterm
.
On these terminals, getting the pixel size using printf "\x1b[14t"
was successful, but getting the pixel size using TIOCGWINSZ
returned 0
.
You might want to address this issue with the Windows Terminal guys at https://github.com/microsoft/terminal. Using termsize
overs SSH on a remote Fedora server it seems to work also:
zcobol@toto:~$ ./termsize
cols 120 rows 30, xpixel 640, ypixel 480.
zcobol@toto:~$ echo $TERM
xterm-256color
Windows Version
Microsoft Windows [Version 10.0.22631.4317]
WSL Version
2.3.24.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.153.1-microsoft-standard-WSL2
Distro Version
Ubuntu 24.04
Other Software
My C application
termsize.c:
Repro Steps
gcc termsize.c -o termsize && ./termsize
cols 163 rows 60, xpixel 0, ypixel 0.
† xpixel and ypixel is fixed value zero.Expected Behavior
Output xpixel and ypixel is correct value.
Actual Behavior
Output xpixel and ypixel is fixed value zero.
Diagnostic Logs
strace output: