Bug 116511 - When copying console font from one tty to another tty it becomes unreadable
Summary: When copying console font from one tty to another tty it becomes unreadable
Status: NEW
Alias: None
Product: Other
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: other_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-16 09:44 UTC by Vjacheslav
Modified: 2016-04-16 09:44 UTC (History)
0 users

See Also:
Kernel Version: Any 4.x version
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Vjacheslav 2016-04-16 09:44:42 UTC
Following code copies console font from tty2 to tty3 and tty3 becomes unreadable

#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/kd.h>
#include <unistd.h>

int main()
{
   int tty3 = open("/dev/tty3", O_RDWR);
   if (tty3 < 0)
      return 1;
   console_font_op cfo = {};
   cfo.op = KD_FONT_OP_COPY;
   cfo.height = 2 - 1; // from tty2
   ioctl(tty3, KDFONTOP, &cfo);
   close(tty3);
   return 0;
}

Steps to reproduce:
1 Go to tty2 and change font with size different from current. For example, run
setfont UniCyr_8x8
2 Run here compiled code from above
3 Go to tty3 and see it


See also https://github.com/systemd/systemd/issues/2784

Note You need to log in before you can comment on or make changes to this bug.