Subject: nano output

nano output

From: Paresh Thakor <>
Date: Wed, 22 Sep 2010 17:22:18 +0530


excerpt from string with libssh2_channel_read()

\x1b)0\x1b7\x1b[?47h\x1b[1;74r\x1b[0m\x0f\x1b[4l\x1b[?7h\x1b[?25h\x1b[?1h\x1b=\x1b[?1h\x1b=\x1b[?1h\x1b=\x1b[39;49m\x1b[39;49m\x1b[0m\x0f\x1b[H\x1b[2J\x1b[0;7m\x0f GNU

NSString conversion of above:

[39;49m[39;49m[0m[H[2J[0;7m GNU nano 2.0.6 New Buffer [73;1H^G[0m Get Help[73;24H[0;7m^O[0m WriteOut[73;47H[0;7m^R[0m Read File[73;70H[0;7m^Y[0m Prev Page[73;93H[0;7m^K[0m Cut Text[73;116H[0;7m^C[0m Cur Pos
[74d[0;7m^X[0m Exit[74;24H[0;7m^J[0m Justify[74;47H[0;7m^W[0m Where Is[74;70H[0;7m^V[0m Next Page[74;93H[0;7m^U[0m UnCut Text[74;116H[0;7m^T[0m To Spell

So, how can i decide that the string is with this color and which character indicates what? What kind of character encoding i need to use to decode the above string, so, i can get idea that 'GNU nano ...' should be printed in reverse mode, etc.? How to decide we need to print tabs, etc? I need to implement virtual terminal but don't know how to decode characters and draw terminal on UIView.

Paresh Thakor.

Received on 2010-09-22