Tips for Terminal C language control cursors under Linux

Source: Internet
Author: User
Tags clear screen


Clear Screen

#define CLEAR () printf ("\033[2j")

Move Cursor up

#define MOVEUP (x) printf ("\033[%da", (x))

Move Cursor Down

#define MOVEDOWN (x) printf ("\033[%db", (x))

Move Cursor Left

#define MOVELEFT (Y) printf ("\033[%dd", (y))

Move Cursor Right

#define MoveRight (Y) printf ("\033[%dc", (y))

Position cursor

#define MOVETO (x, y) printf ("\033[%d;%dh", (×), (y))

Cursor Reset

#define RESET_CURSOR () printf ("\033[h")

Hide cursor

#define HIDE_CURSOR () printf ("\033[?25l")

Display cursor

#define SHOW_CURSOR () printf ("\033[?25h")

Reverse Display

#define Hight_light () printf ("\033[7m")

#define Un_hight_light () printf ("\033[27m")

Tips for Terminal C language control cursors under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.