Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Hello
I have recently been assigned to port and old cobol programm.
I am used to GUI and it i cant understand how TUI work!! I searched a lot through google but could find something....
I knew that console applications could output line by line but how colors etc draw to the terminal screen????How all this stuff is being drawn? .. Do terminals support it somehow?? Is there a standard??? I am really confused !

share|improve this question
1  
What platform(s) will you be using? –  Jon Nov 30 '10 at 19:26
    
Try ui.stackexchange.com –  bigown Nov 30 '10 at 21:48
add comment

3 Answers

up vote 6 down vote accepted

Pretty sure your answer is going to vary based on platform here. There are many different types of terminal/console and for many more than one standard for writing to it. Most of them I have seen use some sort of escape sequence (ex: ANSI char escapes for dos, YMMV) where you send a special escape char to interrupt the writing to the screen then you can move the cursor, change colors, etc.

If you are writing something literally for dumb terminals then probably going to be using something like https://secure.wikimedia.org/wikipedia/en/wiki/Ncurses

share|improve this answer
3  
IBM servers tend to use 3270 and 5250 protocol on top of telnet. Page oriented updates. –  user1249 Nov 30 '10 at 19:29
1  
If he is porting a COBOL/CICS program to a midrange platform then curses is a good suggestion. Question doesn't really tell us enough. –  Jeremy Nov 30 '10 at 20:04
    
A lot of other platforms offer or use a VT-100 or VT-200-compatible protocol, so they'll use the common "ANSI" codes. –  greyfade Nov 30 '10 at 22:09
    
@Thorbjørn Ravn Andersen - Yup. And if you see something called "Novell Virtual Terminal" on top of that, run .. run like hell –  Tim Post Dec 1 '10 at 10:43
    
@Tim, bah, face the challenges instead of cowardly running away! –  user1249 Dec 1 '10 at 17:01
show 1 more comment

Don't worry, there are hundreds of standards to choose from :)

I am sadly more comfortable with text- and console-based applications than their older graphical window brethren. Too many days on FidoNet I fear.

The very first thing I would do is learn a few VT100 codes from the old Digital company. You may never write applications in VT100 codes (likely advise against it), but it is a very good and simple introduction to controlling the console matrix.

Libraries such as curses wrap these control codes (and many other style terminal codes) and abstract them so that users can login via their own terminals. Things like VT100 can even do remote (local) printing with which we still struggle today in RDP.

To make things worse for you, IBM systems use not line- or character-based control, but screen- and block-based protocols. Examples are the 3270 and 5250 terminal protocols which for the lack of a better comparison act in the request|response architecture think HTTP. As capable as these are, they are a true PITA IMNSHO with which to work and should be their own separate question.

Worse than that would be writing a console application in a DOS/Windows world. Do reply with your target development platform.

share|improve this answer
add comment

The generic term for that sort of interface is "command line". You'll probably do better googling for that than for "text user interface".

share|improve this answer
2  
No, a command line utility just gets stdin and arguments and can just output stdout and stderr and a return code. A TUI on the other hand can update every position on the screen and intercepts all terminal input one key at a time. en.wikipedia.org/wiki/Text_user_interface –  Jeremy Nov 30 '10 at 19:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.