wlc icon indicating copy to clipboard operation
wlc copied to clipboard

Could src/session/tty.c possibly just use current tty?

Open ghost opened this issue 9 years ago • 2 comments

At the moment (when running on a text console) it tries to find a new one:

int tty0_fd; if ((tty0_fd = open("/dev/tty0", O_RDWR | O_CLOEXEC)) < 0) die("Could not open /dev/tty0 to find free vt");

int vt; if (ioctl(tty0_fd, VT_OPENQRY, &vt) != 0) die("Could not find free vt");

Couldn't it just use the current tty like weston does?

ghost avatar Feb 28 '16 17:02 ghost

Perhaps i should have made myself a little bit more clear:

just reusing the current tty it doesn't need extra permissions to perform its actions.

usually tty0 is not accessable by a local user.

also a newly created tty will not be usable by the non-root user.

ghost avatar Feb 28 '16 17:02 ghost

If you can send PR for this, I'm willing to accept it. IIRC the permissions vary between distros, and if you have login manager such as logind that sets XDG_VTNR, it will use that VT (e.g. here it definately uses the current tty)

Cloudef avatar Mar 05 '16 11:03 Cloudef