Created
July 19, 2016 09:09
-
-
Save yi-jiayu/aedcbce39ed69844b47e620d72afbe6a to your computer and use it in GitHub Desktop.
Manipulating a compatible terminal using escape sequences
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
main(void) { | |
\\ enter alternate screen mode | |
printf("\033[?1049h"); | |
\\ move the cursor to the upper left corner | |
printf("\033[H"); | |
printf("Hello, World"); | |
\\ move the cursor right 7 steps | |
printf("\033[7C"); | |
\\ move the cursor down 2 steps | |
printf("\033[2B"); | |
printf("Interesting"); | |
\\ exit alternate screen mode | |
printf("\033[?1049l"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment