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

The pixel information obtained by TIOCGWINSZ is incorrect. #18192

Open
mikoto2000 opened this issue Nov 14, 2024 · 1 comment
Open

The pixel information obtained by TIOCGWINSZ is incorrect. #18192

mikoto2000 opened this issue Nov 14, 2024 · 1 comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@mikoto2000
Copy link

Windows Terminal version

1.22.2912.0

Windows build number

10.0.22631.0

Other Software

My application.

termsize.c:

#include <fcntl.h>
#include <termios.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/ioctl.h>

void main() {
  struct winsize ws;
  int fd = open("/dev/tty", O_RDONLY);
  if(fd == -1) {
    fprintf(stderr, "Can't open tty");
    return;
  }
  int ret = ioctl(fd, TIOCGWINSZ, &ws);
  close(fd);
  fprintf(stderr, "cols %d rows %d, xpixel %d, ypixel %d.\n", ws.ws_col, ws.ws_row, ws.ws_xpixel, ws.ws_ypixel);
}

Steps to reproduce

  1. Run gcc termsize.c -o termsize && ./termsize
  2. Output stderr cols 163 rows 60, xpixel 0, ypixel 0. † xpixel and ypixel is fixed value zero.

(I was recommended to ask here in the comments at microsoft/WSL#12265, so I am asking here as well.)

Expected Behavior

Output xpixel and ypixel is correct value.

Actual Behavior

Output xpixel and ypixel is fixed value zero.

@mikoto2000 mikoto2000 added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 14, 2024
Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

1 participant