Hi,

    My problem is as follows: in application to get data from stdin I use
gets. When running program with linux console as controlling terminal,
backspace character works (because linux buffers input for me and give
complete line to program). But when I run programm in telnet session and use
basckspace (to edit data that was typed with mistake), I get "^[.." things -
control codes displayed in ASCII.
    I can turn this behaviour off by turning off terminal attribute ECHOCTL.
But that does not solve the problem - I receive all those controlcodes into
string I read from stdin (e.g. backspace as 0x08), and backspace moves
cursor 1 position back, not deleting character. Is the only way to make
backspace work to turn off echo, disable canonical mode and process each
character, implementing echo by myself on stdout, and take proper action
when non-printable characer is received?
    If I am missing something from these crazy terminal things, please
enlighten me!

    Maybe there is something to do with termcap? As far as I understand,
this database contains "strings" which I have to type when I want to do some
action (e.g. to move cursor up). Is that right?

Thank you,
Karlis

P.S. Do not suggest to use ncurses... There must be another way out...

Reply via email to