Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Escape Sequence and terminal emulator

Status
Not open for further replies.

saif

Programmer
Mar 28, 2001
47
0
0
Hi

can anybody tell me in detail what is escape sequence.

I am developing an application that will send information to Terminal emulator. And will take response from Teminal emulator.

Question is: Suppose I want to take info from user of termainl emulator about user name and passwrod. how i will take inut from user and how will i get user enterd name and password

Thanks
Saif
 
Usually when characters are sent to a terminal the characters will be displayed on the terminal. However if you want the terminal to take some action such as clear the screen then you nned to send an escape sequence to the terminal.

Different devices have different escape sequences. For example, the printer control languages for Hewlett Packard printers are different to the printer control languages for Epson printers. Printer control language is another term for the escape sequences supported by the printer.

One of the great strengths of Windows is that these differences have largely been hidden from programmers and users.

There is an ANSI standard for escape sequences. This is ANSI X3.64. There may be others.

Typically an escape sequence starts with the Escape character, $27, and is followed by one or more characters.

An example: in ANSI X3.64, the code to clear the screen is the four byte sequence ESC [ 2 J. This is $1B, $5B, $32, $4A in hexadecimal.

You will need to find out what escape sequences are supported for your terminal.

Andrew
 
I THINK

i don't know if i can help you and if this is the
escape sequence you are looking for but when writting for a terminal prog you are treating input chars like:

{imagine clean pascal}
Code:
var
   ch1, ch2: char;

procedure getkeyhitten;
begin
  if keypressed then 
  begin  
    ch1 := readkey;
    if ch1 = #0 then {a #0 start character pressed}
       ch2 := readkey
     else
        ch2 := #0;
  end;
end;
  
begin
  repeat
      getkeyhitten;
      if ch1<>#0 then write(ch1)
      else 
         case  ch2 of
             #45: writeln('you pressed alt-x, exiting');
          end;  
  until ch2 = #45;
end;

this how you can control the control keys sequence of the key hitten i hope im helping a bit else reg flad me lol :)

the same way you can control the esc sequence, but that you are looking for it sound like macro-scripting?
 
hi towerbase/petmakris

Thanks for replying. I have done all these thing that you have written using Delphi.
Let suppose using escape sequence i am able to write something on screen of terminal emulaotr. e.g.

Login Name:
Password:

Suppose above is my screen.

Now i want that user of the emulator is to write his name and password as below

Login Name: saif
Password: ******

How is it possible that user will be able to write something on Emulator and when user will be able to write then how my host application will get all this info.


Thanks
Saif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top