Terminal settings (TIOCGWINSZ) when using simulators

Heinz Junkes junkes at fhi-berlin.mpg.de
Thu Apr 8 17:51:06 UTC 2021


If I use e.g. sparc6-rtems-sis and query the terminal window 
size within rtems_task_Init, the output for winsize.ws_row and winsize.ws_col is "0”.

/*
 * get winsize example
 */
#include <rtems.h>
#include <stdlib.h>
#include <stdio.h>

#include <sys/ioctl.h>
#include <unistd.h>

rtems_task Init(
  rtems_task_argument ignored
)
{
  struct winsize w;

 /* gets for both values “0” */
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
  printf("lines %d\n", w.ws_row);
  printf("columns %d\n", w.ws_col);

  /* this sets the terminal size, works with terminal emulator (vt100?) … */
  printf("\033[8;10;100”);
  
 /* but still “0” gets read */
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
  printf("lines %d\n", w.ws_row);
  printf("columns %d\n", w.ws_col);

/* setting values with TIOCSWINZ has no impact on the terminal */

  exit( 0 );
}

Is it possible to define the size of the terminals when starting the simulators/emulators?

Danke Heinz
 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2542 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20210408/60a87429/attachment.bin>


More information about the users mailing list