[svlug] App called during boot, weird backspace behavior

Ivan Passos lists at cyclades.com
Wed Nov 14 18:38:02 PST 2001


Hello,

I have a C application that reads strings typed by the user. Basically, it
does the following:

tostr	-> the char vector that will hold the string
maxlen	-> the maximum length of the input string
stdin	-> standard input file descr.

	fgets(tostr, maxlen, stdin);
	tostr[strlen(tostr)-1] = '\0';


This app. works fine when called from a shell, but if I run it from one of
the init scripts (_very_ early on, called by the rcS script), I get a
weird behavior on backspace handling / displaying on the screen.

Normally I would get the following (i.e. app run from a regular shell):

asdfg
{type BS}
asdf
{type BS}
asd
{type 'h'}
asdh
{type 'j'}
asdhj

In this case, I get the following (i.e. app run from the init script):

asdfg
{type BS}
asdfg\g
{type BS}
asdfg\gf
{type 'h'}
asdfg\gf/h
{type 'j'}
asdfg\gf/hj


The end result (i.e. the string read by the app) is correct, but this
screen output is really confusing to the user!!

I've tried setting the TERM variable to 'linux', 'ansi', 'vt100', hoping
that this was the reason (just because the app is called so early during
the boot process -- yes, it was just a wild guess), but it didn't help.

BTW, this system uses a serial console (no VGA console available).

Does anyone have a clue as to why this is happening and how to fix it?

Thanks in advance for your help!

Later,
Ivan





More information about the svlug mailing list