ANSI escape code, ansiescapecode

Source: Internet
Author: User

ANSI escape code, ansiescapecode

Recently, I am working on the SSH Terminal Project on iOS. It is mainly to remotely connect to Unix systems on mobile phones and perform some simple commands, similar to SecureCRT; today I want to summarize the new thing encountered in this project-ANSI escape code.

Excerpt https://en.wikipedia.org/wiki/ansi_escape_codebrief: in computing,ANSI escape codes(OrEscape sequences) Are a method using in-band signaling to control theformatting, color, and other output options on video text terminals. to encode this formatting information, certain sequences of bytes are embedded into the text, which the terminal looks for and interprets as commands, not ascharacter codes. to put it simply, we generally use terminal terminals, such as command terminals on Linux, Mac, and Unix, the ANSI control code is used to control the format and some control operations of the displayed text.

The data transmitted by the terminal contains the ANSI control code, which must be decoded to display the color and font of the text. So I searched for it on github and found it. Here I have to praise the greatness of the open source spirit. Thank you for the coders who contributed to the open source. One thing to note here is that some open-source projects may have been in use for a long time, and the author has not updated them. They may be inconsistent with your requirements. We need to modify some things when using them simply and rudely, I think this is a good opportunity to learn. You can read the source code and make some modifications that meet your needs.

Summary: first, this article mainly introduces the text format of the processing terminal. What you need to know is the ANSI escape code, an open-source project for decoding on github. Second, I think, necessary end for blog writing, hey ~ This kind of project was rarely done before, and is generally used for some mainstream functions of iOS. Fortunately, some Linux development things were introduced during college, if you don't even know what the basic Linux terminal commands are, it's a little difficult. However, the more difficulties you have, the more things you want to learn. In addition to accumulating knowledge, you will also learn more and more ideas to handle problems, and your abilities will naturally be improved, although the process is abusive, it feels amazing. PS: the first time a blog is written, the level is limited. If the content above is biased, please correct me.

Related Article

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.