Skip to content

Instantly share code, notes, and snippets.

@jsm222
Created August 26, 2022 19:48
Show Gist options
  • Save jsm222/d894e41172fbcc69e3c856dc6239fef5 to your computer and use it in GitHub Desktop.
Save jsm222/d894e41172fbcc69e3c856dc6239fef5 to your computer and use it in GitHub Desktop.
#include <sys/ioctl.h>
#include <unistd.h>
#include <sys/consio.h>
#include <fcntl.h>
int main() {
int fd = open("/dev/console", O_WRONLY | O_NOCTTY);
ioctl(fd,VT_ACTIVATE,3);
close(fd);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment